Cannot load csv file from AWS url using pandas

Viewed 25

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)
1 Answers

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.

Related