简体   繁体   中英

Cannot load csv file from AWS url using pandas

I am trying to load the csv file from the url below but get an 'Python int too large to convert to C long' error. Not entirely sure how to fix it. Skipping 5 rows because that's where the headers are.

import pandas as pd
urlEC2='https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.csv'
data= pd.read_csv(urlEC2,skiprows=5)

This error usually happens when the integer limit on the runtime is more than the integer limit defined by sys.maxsize. It would be helpful if you can show the full error that you are getting.

I have never personally read file from a url but this is what I do when I want to read a csv file but skip the first 5 rows:

pd.read_csv("example.csv", skiprows = [1, 2, 3, 4, 5])

Not sure if I helped or confused you more, But if you can maybe show the full error and the exact line where the error is being thrown, I can help more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM