Answer to Question #262656 in Python for Gopi

Question #262656

Write short note on following:


a) How to create One-dimensional array?


b) How to identify datatype for numpy array?

1
Expert's answer
2021-11-08T05:32:28-0500
1) 
import numpy as np
  
lst = [10, 22, 40, 56]
  
# creating one dimensional array
n = np.array(lst)
print(n)

2)
import numpy as np
 
arr = np.array([1, 2, 3, 4, 5])
 
print('Datatype:', arr.dtype)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS