O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a DataFrame using NumPy function results

A data frame can be created from a one-dimensional NumPy array of integers ranging from 1 to 5:

The first column of the output shows the labels of the index that was created. Since an index was not specified at the time of creation, pandas created a based RangeIndex with labels starting at 0.

The data is in the second column and consists of the values 1 through 5. The 0 above the column of data is the name of the column. When the column names are not specified at the time of the creation of the data frame, pandas names the columns with incremental integers starting at 0.

A multi-dimensional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required