Code Monkey home page Code Monkey logo

pandas-cookbook-second-edition's Issues

KeyError: '[1.0] not in index'

in chapter 9, page 357, There's more…, returns an error "KeyError: '[1.0] not in index'" in jupyter notebook, while it shows no error in chapter 9 attachment.

include="int" should be "int64"

In Chapter 2 Selecting columns with methods, step 2 has the following
movies.select_dtypes(include="int").head()
When run this will only show the index column.

To match the intent of the section and the output in the book, the code should be
movies.select_dtypes(include="int64").head()

Please update path of the data files

In Chapter 1 notebook, we have the following which throws an error
movies = pd.read_csv('data/movie.csv')

Since the data is stored in the top-level folder, the path has to be changed to make it work. Can you please update the path to make it work in all the chapter workbooks?

movies = pd.read_csv('../data/movie.csv')

Chapter 1: Issue with Pandas 1.5

pd.set_option('max_columns', 4, 'max_rows', 10) will return the error OptionError: Pattern matched multiple keys
To solve this replace 'max_columns' and 'max_rows' with 'display.max_columns' and 'display.max_columns' respectively. The final result should be pd.set_option('display.max_columns', 4, 'display.max_rows', 10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.