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

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:

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