Skip to Main Content
Hands-On Data Analysis with NumPy and pandas
book

Hands-On Data Analysis with NumPy and pandas

by Curtis Miller
June 2018
Beginner to intermediate content levelBeginner to intermediate
168 pages
3h 40m
English
Packt Publishing
Content preview from Hands-On Data Analysis with NumPy and pandas

Creating DataFrames

Series are interesting, primarily because they are used to build pandas DataFrames. We can think of a pandas DataFrame as combining series together to form a tabular object, with rows and columns being the series. We can create DataFrames in a variety of ways and we will be demonstrating some here. We can give a DataFrame an index. We can also manually specify the names of columns by setting the columns argument. Choosing column names follows the same rules as choosing index names.

Let's see some of the ways we can create DataFrames. The first thing we will do is create DataFrames, and we are not going to care too much about their indices. We can create a DataFrame from a NumPy array:

Here, we have a three-dimensional ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Data Analysis with Pandas

Hands-On Data Analysis with Pandas

Stefanie Molin
Python: End-to-end Data Analysis

Python: End-to-end Data Analysis

Phuong Vothihong, Martin Czygan, Ivan Idris, Magnus Vilhelm Persson, Luiz Felipe Martins
Python: Data Analytics and Visualization

Python: Data Analytics and Visualization

Phuong Vo.T.H, Martin Czygan, Ashish Kumar, Kirthi Raman

Publisher Resources

ISBN: 9781789530797Supplemental Content