Array creation using List
Arrays are used to store multiple values in one single variable.Python does not have built-in support for Arrays, but Python lists can be used instead.
Example :
arr = [1, 2, 3, 4, 5]
arr1 = ["geeks", "for", "geeks"]
# Python program to create
# an array
# Creating an array using list
arr=[1, 2, 3, 4, 5]
for i in arr:
print(i)
Output:
1
2
3
4
5
Numpy | Array Creation
In this article, we are going to explore numpy array creation technique.
Table of Content
- Array creation using List :
- Array creation using array functions
- Methods for array creation in Numpy
Contact Us