Book Image

Learning pandas - Second Edition

By : Michael Heydt
Book Image

Learning pandas - Second Edition

By: Michael Heydt

Overview of this book

You will learn how to use pandas to perform data analysis in Python. You will start with an overview of data analysis and iteratively progress from modeling data, to accessing data from remote sources, performing numeric and statistical analysis, through indexing and performing aggregate analysis, and finally to visualizing statistical data and applying pandas to finance. With the knowledge you gain from this book, you will quickly learn pandas and how it can empower you in the exciting world of data manipulation, analysis and science.
Table of Contents (16 chapters)

Accessing CSV data on the web

It is quite common to read data off the web and from the internet. Pandas makes it easy to read data from the web. All the pandas functions that we have examined can also be given an HTTP URL, FTP address, or S3 address, instead of a local file path, and all of them work just the same as they work with a local file.

The following demonstrates how easy it is to directly make HTTP requests using the existing pd.read_csv() function. The following retrieves the daily stock data for Microsoft in April 2017, directly from the Google Finance web service via its HTTP query string model: