python - IOError when trying to convert CSV into dataframe -


i want try , understand why error in following code. error ioerror: [errno 2] no such file or directory: 'f17-yields.csv'

import urllib2 import pandas pd import os  url = 'http://www.rba.gov.au/statistics/tables/csv/f17-yields.csv'  response = urllib2.urlopen(url) html = response.read()  dataframeofxls_file = pd.excelfile(os.path.basename(url)) print dataframeofxls_file 

cheers

you have few problems. first downloading csv file, not saving locally, , trying open non-existent local file.

second, csv file not excel file, , don't need pd.excelfile open it. try csv reader instead. example:

import pandas pd  url = 'http://www.rba.gov.au/statistics/tables/csv/f17-yields.csv' pd.read_csv(url) 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -