Learning pandas
eBook - ePub

Learning pandas

Michael Heydt

Share book
  1. 504 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning pandas

Michael Heydt

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning pandas an online PDF/ePUB?
Yes, you can access Learning pandas by Michael Heydt in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación en Python. We have over one million books available in our catalogue for you to explore.

Information

Learning pandas


Table of Contents

Learning pandas
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. A Tour of pandas
pandas and why it is important
pandas and IPython Notebooks
Referencing pandas in the application
Primary pandas objects
The pandas Series object
The pandas DataFrame object
Loading data from files and the Web
Loading CSV data from files
Loading data from the Web
Simplicity of visualization of pandas data
Summary
2. Installing pandas
Getting Anaconda
Installing Anaconda
Installing Anaconda on Linux
Installing Anaconda on Mac OS X
Installing Anaconda on Windows
Ensuring pandas is up to date
Running a small pandas sample in IPython
Starting the IPython Notebook server
Installing and running IPython Notebooks
Using Wakari for pandas
Summary
3. NumPy for pandas
Installing and importing NumPy
Benefits and characteristics of NumPy arrays
Creating NumPy arrays and performing basic array operations
Selecting array elements
Logical operations on arrays
Slicing arrays
Reshaping arrays
Combining arrays
Splitting arrays
Useful numerical methods of NumPy arrays
Summary
4. The pandas Series Object
The Series object
Importing pandas
Creating Series
Size, shape, uniqueness, and counts of values
Peeking at data with heads, tails, and take
Looking up values in Series
Alignment via index labels
Arithmetic operations
The special case of Not-A-Number (NaN)
Boolean selection
Reindexing a Series
Modifying a Series in-place
Slicing a Series
Summary
5. The pandas DataFrame Object
Creating DataFrame from scratch
Example data
S&P 500
Monthly stock historical prices
Selecting columns of a DataFrame
Selecting rows and values of a DataFrame using the index
Slicing using the [] operator
Selecting rows by index label and location: .loc[] and .iloc[]
Selecting rows by index label and/or location: .ix[]
Scalar lookup by label or location using .at[] and .iat[]
Selecting rows of a DataFrame by Boolean selection
Modifying the structure and content of DataFrame
Renaming columns
Adding and inserting columns
Replacing the contents of a column
Deleting columns in a DataFrame
Adding rows to a DataFrame
Appending rows with .append()
Concatenating DataFrame objects with pd.concat()
Adding rows (and columns) via setting with enlargement
Removing rows from a DataFrame
Removing rows using .drop()
Removing rows using Boolean selection
Removing rows using a slice
Changing scalar values in a DataFrame
Arithmetic on a DataFrame
Resetting and reindexing
Hierarchical indexing
Summarized data and descriptive statistics
Summary
6. Accessing Data
Setting up the IPython notebook
CSV and Text/Tabular format
The sample CSV data set
Reading a CSV file into a DataFrame
Specifying the index column when reading a CSV file
Data type inference and specification
Specifying column names
Specifying specific columns to load
Saving DataFrame to a CSV file
General field-delimited data
Handling noise rows in field-delimited data
Reading and writing data in an Excel format
Reading and writing JSON files
Reading HTML data from the Web
Reading and writing HDF5 format files
Accessing data on the web and in the cloud
Reading and writing from/to SQL databases
Reading data from remote data services
Reading stock data from Yahoo! and Google Finance
Retrieving data from Yahoo! Finance Options
Reading economic data from the Federal Reserve Bank of St. Louis
Accessing Kenneth French's data
Reading from the World Bank
Summary
7. Tidying Up ...

Table of contents