Python Numpy - 03 Creating Numpy Array

Опубликовано: 04 Июль 2017
на канале: Ashman Malhotra
192
6

"Creating Numpy Array"
*********************************************************************
In this lesson, I discussed how you can create Numpy Array.

Before moving ahead with creating Numpy Array, I will create Python List and will show you how to check it type and elements. Then, I will import numpy package in current context as:

import numpy as np

With above statement, the numpy package will be imported and we will be ready to work with numpy. With previously created Python list, we will create numpy array. This will be an example of One Dimensional Numpy array. I will also discuss some important attributes of the numpy array:

1. dtype
2. shape
3. size
4. itemsize
5. ndim

The dtype attribute of the numpy returns the type of the elements of the Numpy array.
The shape attribute of the numpy returns the shape of the numpy array.
The size attribute of the numpy returns the size of the numpy array.
The itemsize attribute returns the itemsize of each element of the array.
The ndim attribute returns the number of Array Dimension.

I will also discuss examples of creating one dimensional as well as two dimensional Numpy Array.

When you declare Numpy array, the numpy array object will automatically be assigned a type depending the items within the array. You will also learn how to assign specific data type to the array elements while declaration or creation of the array.

   • Python Numpy - 03 Creating Numpy Array  
*********************************************************************
Please subscribe to my channel:
https://www.youtube.com/c/ashmanmalho...
*********************************************************************
Thank you for watching my video on "Python Numpy"
*********************************************************************
Contact: [email protected] for training inquiries
*********************************************************************
"Python Numpy Tutorials" | "Python Numpy" | "Numpy" | "Data Science" | "Data Science Using Python" | "Creating Numpy Array"