Skip to Content
Pandas for Everyone: Python Data Analysis, First Edition
book

Pandas for Everyone: Python Data Analysis, First Edition

by Daniel Y. Chen
December 2017
Beginner to intermediate
410 pages
12h 45m
English
Addison-Wesley Professional
Content preview from Pandas for Everyone: Python Data Analysis, First Edition

R. numpy ndarray

The numpy library1 gives Python the ability to work with matrices and arrays.

1. https://docs.scipy.org/doc/numpy/index.html

import numpy as np

Pandas started off as an extension to numpy.ndarray that provided more features suitable for data analysis. These days, Pandas has evolved to the point where it shouldn’t be thought of as a collection of numpy arrays, since the two libraries are different.

import pandas as pd df = pd.read_csv('../data/concat_1.csv') print(df)

    A   B   C   D 0  a0  b0  c0  d0 1  a1  b1  c1  d1 2  a2  b2  c2  d2 3  a3  b3  c3  d3

If you do need to get the numpy.ndarray values from a Series or DataFrame, you can use the values attribute.

a ...

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

Pandas for Everyone: Python Data Analysis, 2nd Edition

Pandas for Everyone: Python Data Analysis, 2nd Edition

Daniel Y. Chen

Publisher Resources

ISBN: 9780134547046Purchase book