Code Monkey home page Code Monkey logo

pandas-cookbook-second-edition's Introduction

Pandas 1.x Cookbook - 2nd Edition

This is the code repository for Pandas 1.x Cookbook - 2nd Edition, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

A new edition of the bestselling Pandas cookbook updated to pandas 1.x with new chapters on creating and testing, and exploratory data analysis. Recipes are written with modern pandas constructs. This book also covers EDA, tidying data, pivoting data, time-series calculations, visualizations, and more.

Instructions and Navigation

All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

The code will look like the following:

def tweak_kag(df):
    na_mask = df.Q9.isna()
    hide_mask = df.Q9.str.startswith('I do not').fillna(False)
    df = df[~na_mask & ~hide_mask]

Related Products

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781839213106

pandas-cookbook-second-edition's People

Contributors

gauravgavas avatar kishorrit avatar mattharrison avatar packt-itservice avatar packtutkarshr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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()

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)

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')

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.