Created
January 15, 2019 11:34
-
-
Save mewforest/056ded48eb5b1e350821cd6d6965580e 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
import numpy as np | |
# одномерный массив | |
x = np.array([1, 4, 5, 8], float) | |
print(x, '||', type(x)) | |
# матрица | |
a = np.array([[1, 2, 3], [4, 5, 6]], float) | |
print(a) | |
print('Первый элемент {}, первая строка {}, первый столбик {}'.format(a[0, 0], a[0, :], a[:, 0])) | |
# матрица длина | |
print('Длина: {}'.format(len(a))) | |
print('Есть ли 2? {}'.format(2 in a)) | |
# объединение | |
a = np.array([[1, 2], [3, 4]], float) | |
b = np.array([[5, 6], [7, 8]], float) | |
c = np.concatenate((a, b)) | |
print(c) | |
# поворот | |
c = np.rot90(c) | |
print(c) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment