-
-
Save Damian89/88f46d15b15fd2b48aac7704029aa4c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # coding: utf8 | |
| import numpy | |
| # Simple Listen... | |
| array1 = [1, 2.2, 3, ] | |
| array2 = [6, 7.1, 8, ] | |
| # Schnell in numpy objekte umwandeln | |
| array1 = numpy.array(array1) | |
| array2 = numpy.array(array2) | |
| # Und damit hat man dann einige nette Funktionen: | |
| # Maximaler Wert des Arrays | |
| print(array1.max()) | |
| # 3.0 | |
| # Durchschnitt aller Werte | |
| print(array1.mean()) | |
| # 2.06666667 | |
| # Machen wir aus beiden Arrays ein 2 Dimensionales Array mit dem ersten Array als erste Spalte | |
| # und dem zweiten Array als zweite Spalte | |
| array1_2 = numpy.column_stack((array1, array2)) | |
| print(array1_2) | |
| #[[ 1. 6. ] | |
| # [ 2.2 7.1] | |
| # [ 3. 8. ]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment