Here is an example on how to read CSV file from URL.
Census data used as source.
Use Case : Read Population data for state of California from "censusdata.ire.org" URL and display the data.
pandas.read_csv(URL)
Separator or delimiter :
header :
usecols :
skiprows :
skipfooter :
Census data used as source.
Use Case : Read Population data for state of California from "censusdata.ire.org" URL and display the data.
Syntax :
Main Parameters :
- sep='|'
- delimiter='|'
- default ‘,’
header :
- header='infer'
- default ‘infer’'
usecols :
- For subset of columns
- usecols=None
skiprows :
- Number of lines to skip at the start
- default 0
skipfooter :
- Number of lines to skip at the bottom
- default 0
Sample Code
#################
# Sample Code
#################
# Sample Code
#################
import pandas as pd
df = pd.read_csv("http://censusdata.ire.org/06/all_050_in_06.P1.csv")
df.head(5)
No comments:
Post a Comment