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

Create NumPy arrays in Python - Python Tutorial

From the course: Python Functions for Data Science

Start my 1-month free trial

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…

Contents