playground-ta42be1o
Tech.io playground
Welcome!
NumPy a Python Library
print('Hello World: we will gonna talk about NumPy which is a library of Python!')
declaring new array and printing array elements 1
import numpy as np
print("Numpy library in Python")
# declaring new array
data = np.array([1,2,3,4,5,6,7])
# printing array elements
print(data)
declaring new array and printing array elements 2
import numpy as np
print("Numpy library in python")
# declaring new array
data = np.array(["Apple", "Oranges", "Grapes", "Banana"])
# printing array elements
print(data)
adding two arrays
# adding two arrays
data1 = np.array([7,4,3,2,1,8, 9])
data3 = data+data1
print(data3)
Copy array
data1 = np.array([7,4,3,2,1,8, 9])
data2 = data1
print(data2)
```and```
data1 = np.array([7,4,3,2,1,8, 9])
data2 = data1.copy()
print(data2)
full is used for creating multi D array of your own choice elements
# full is used for creating multi D array of your own choice elements
values = np.full([5,5],0)
print(values)
# all elemnts should be xero
values = np.zeros([9,9])
print(values)
# all elemnts should be ONES now
values = np.ones([3,3])
print(values)
print("\n\n")
dta = np.full([5,5],9)
print(dta)
Advanced usage
If you want a more complex example (external libraries, viewers...), use the Advanced Python template