From the course: Python Functions for Data Science
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create NumPy arrays in Python - Python Tutorial
From the course: Python Functions for Data Science
Create NumPy arrays in Python
- [Instructor] The NumPy library contains powerful tools for manipulation of numerical data in Python. It has several functions that are useful for performing mathematical and logical operations on arrays with various dimensions. A NumPy array is essentially a grid-like data structure containing values of the same data type. NumPy arrays that are one-dimensional are considered vectors while NumPy arrays that are multidimensional are considered matrices. There are different ways of creating NumPy arrays and I'll be showing you a handful of them. First I'll import the NumPy library and give it the alias NP. Let's say that I want to create an empty NumPy array and save it in a variable. To do this, I can use NumPy's array function which takes in an array like objects such as a Python list as input and returns a NumPy array containing the items from the specified input. I can call NumPy's array function and pass in an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Create NumPy arrays in Python5m 30s
-
(Locked)
Minimum and maximum values in NumPy arrays51s
-
Indices of min and max values in NumPy arrays1m 4s
-
(Locked)
Find shapes of NumPy arrays and reshape4m 23s
-
(Locked)
Select items or groups of items from NumPy arrays4m 35s
-
(Locked)
Arithmetic operations on NumPy arrays2m 5s
-
(Locked)
Scalar operations on NumPy arrays1m 33s
-
(Locked)
Statistical operations on NumPy arrays56s
-
(Locked)
Other operations on NumPy arrays2m 58s
-
(Locked)
-
-
-
-
-