Comments (4)
can we see your full code and the file you are try to read?
from pandas-cookbook.
Once I saw the error, I went back and did straight copy/paste from the tutorial to make sure I wasn't making any typing errors. Here's what I have:
In [1]: import pandas as pd
pd.set_option('display.mpl_style', 'default')
print('Ready')
I don't use "figsize(15,3)" since that doesn't seem to work with python 3. BTW, here's everything I'm using:
Python version 3.4.3 |Anaconda 2.2.0 (x86_64)| (default, Mar 6 2015, 12:07:41)
[GCC 4.2.1 (Apple Inc. build 5577)]
Pandas version: 0.15.2
In [3]: url_template = "http://climate.weather.gc.ca/climateData/bulkdata_e.html?format=csv&stationID=5415&Year={year}&Month={month}&timeframe=1&submit=Download+Data"
url = url_template.format(month=3, year=2012)
weather_mar2012 = pd.read_csv(url, skiprows=16, index_col='Date/Time', parse_dates=True, encoding='latin1')
weather_mar2012
The result is this:
ValueError Traceback (most recent call last)
in ()
----> 6 weather_mar2012 = pd.read_csv(url, skiprows=16, index_col='Date/Time', parse_dates=True, encoding='latin1')
...
--> 465 return _read(filepath_or_buffer, kwds)
...
--> 241 parser = TextFileReader(filepath_or_buffer, *_kwds)
...
--> 557 self._make_engine(self.engine)
...
--> 694 self._engine = CParserWrapper(self.f, *_self.options)
...
--> 1061 self._reader = _parser.TextReader(src, **kwds)
...
pandas/parser.pyx in pandas.parser.TextReader.cinit (pandas/parser.c:4804)()
ValueError: No columns to parse from file
from pandas-cookbook.
I have had the same problem with tutorial 5 I think, though I am using python 2.7 something. I had no problem with the prior four tutorials and learned a lot, but I got stuck on the In[4] even though I am able to download the file on my own cutting and pasting the URL into my own browser.
from pandas-cookbook.
Oh cool, I just looked at the tutorials here (and not at the Pandas site). Code here works. Thank you!
from pandas-cookbook.
Related Issues (20)
- ImportError: No module named notebook.notebookapp
- Update to Chapter 6
- Unspecified why used .loc()
- Chapter 1: first cell raises FutureWarning about mpl_style HOT 1
- Chapter 5 - the url template is outdated leading to 404: Not Found HOT 12
- Where is semicolon separated bikes.csv file? HOT 1
- Chapter 1: broken dataframe file is really broken HOT 2
- Chapter 7.3: pandas.DataFrame.sort()
- Dockerfile Out-of-Date
- Feature: Run Examples Online
- Prueba
- readme.md links
- Ch.3 link is out of date on your site
- Is there a known port for Python 3? HOT 2
- Chapter 4 TypeError:unhashable type:'slice' HOT 1
- Chapter 4 TypeError:unhashable type:'slice' HOT 2
- Binder: Could not find a version that satisfies the requirement matplotlib==3.7.1
- Something is wrong here where Binder doesn't work HOT 1
- Broken link on the home page
- Issue with MyBinder Build: pip install command fails with non-zero exit code 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas-cookbook.