Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 1: broken dataframe file is really broken #58

Open
leonprou opened this issue Oct 13, 2017 · 2 comments
Open

Chapter 1: broken dataframe file is really broken #58

leonprou opened this issue Oct 13, 2017 · 2 comments

Comments

@leonprou
Copy link

leonprou commented Oct 13, 2017

In the cookbook Chapter 1 we start with command

broken_df = pd.read_csv('../data/bikes.csv')

That suppose to give a bad input. But when I try this command I get an exception:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 15: invalid continuation byte

The fixed version of the command seems to work good.

I use:
python 3.5.1,
pandas 20.3
MacOS

Update:
After giving another look into the readme file, it is stated that the project is set to work with Python 2.7. But it would be nice to make it Python 3 compatible also.

@fenchu
Copy link

fenchu commented Apr 15, 2018

This works fine with python3. just tested 3.6.5, You are supposed to get UnicodeDecodeError first, but the next works fine.

@BenQuigley
Copy link

I don't think a UnicodeDecodeError resulted when the notebook was first written, because in block 5 the author continues to work with broken_df as though Python had assigned it a value without erroring out:

# Look at the first 3 rows
broken_df[:3]

The point of block 4 is to demonstrate that the default settings of read_csv might not work, but maybe the notebook should be updated to acknowledge that an error is actually expected from that line as written, not for the dataframe to be read incorrectly as (I assume) happened in Python 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants