We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c6eb34 commit ff2651eCopy full SHA for ff2651e
1 file changed
Numpy/P01_Introduction.py
@@ -57,3 +57,27 @@
57
58
# to check the data we have dtype.
59
print(myArray.dtype) # int64
60
+
61
+# zeros creates an array will all zeros
62
+myArray = np.zeros((3, 4))
63
+print(myArray)
64
65
+# [[ 0. 0. 0. 0.]
66
+# [ 0. 0. 0. 0.]
67
+# [ 0. 0. 0. 0.]]
68
69
+# ones creates an array with all ones
70
+myArray = np.ones((3, 4))
71
72
73
+# [[ 1. 1. 1. 1.]
74
+# [ 1. 1. 1. 1.]
75
+# [ 1. 1. 1. 1.]]
76
77
+# numpy random module helps to initialize array with random values
78
+myArray = np.random.rand(3, 4)
79
80
81
+# [[ 0.54808903 0.08750717 0.23886267 0.93589283]
82
+# [ 0.90750146 0.31197039 0.54013725 0.91092763]
83
+# [ 0.38827674 0.04647878 0.15997665 0.94909537]]
0 commit comments