Pandas in Action
Boris Paskhaver
  • MEAP began February 2020
  • Publication in Spring 2021 (estimated)
  • ISBN 9781617297434
  • 525 pages (estimated)
  • printed in black & white

An outstanding Pandas reference for for developers just starting to use Pandas and/or Python for data analysis or data science.

Jeff Smith
Pandas has rapidly become one of Python's most popular data analysis libraries. With pandas you can efficiently sort, analyze, filter and munge almost any type of data. In Pandas in Action, a friendly and example-rich introduction, author Boris Paskhaver shows you how to master this versatile tool and take the next steps in your data science career.

About the Technology

Anyone who’s used spreadsheet software will find pandas familiar. While its column-based grids might remind you of Excel or Google Sheets, pandas is more flexible and far more powerful. It can efficiently perform operations on millions of rows and be used in tandem with other Python libraries for statistics, machine learning, and more. And best of all, using pandas doesn’t mean sacrificing user productivity or needing to write tons of complex code. It’s clean, intuitive, and fast.

About the book

Pandas in Action makes it easy to dive into Python-based data analysis. You’ll learn to use pandas to automate repetitive spreadsheet functionality and derive insight from data by sorting columns, filtering data subsets, and creating multi-leveled indices. Each chapter is a self-contained tutorial, letting you dip in when you need to troubleshoot tricky problems. Best of all, you won’t be learning from sterile or randomly created data. You’ll start with a variety of datasets that are big, small, incomplete, broken, and messy and learn how to clean and format them for proper analysis.
Table of Contents detailed table of contents

Part 1: Getting Started

1 Introducing Pandas

1.1 Data in the 21st Century

1.2 Introducing pandas

1.2.1 Pandas vs Graphical Spreadsheet Applications

1.2.2 Pandas vs Its Competitors

1.3 Importing a Dataset

1.4 Manipulating a DataFrame

1.5 Counting Values in a Series

1.6 Filtering a Column by One or More Criteria

1.7 Grouping Data

1.8 Summary

Part 2: The Python Ecosystem

2 Python Crash Course

2.1 Simple Data Types

2.1.1 Numbers

2.1.2 Strings

2.1.3 Booleans

2.2 Operators

2.2.1 Mathematical Operators

2.2.2 Equality and Inequality Operators

2.3 Variables

2.4 Functions

2.4.1 Arguments and Return Values

2.4.2 Custom Functions

2.5 Objects and Methods

2.5.1 Atributes

2.5.2 Methods

2.5.3 Additional String Methods

2.6 Lists

2.6.1 List Iteration

2.6.2 List Comprehension

2.6.3 Converting a String to a List and Vice Versa

2.7 Tuples

2.8 Dictionaries

2.8.1 Dictionary Iteration

2.9 Sets

2.9.1 Set Operations

2.10 Modules, Classes, and Datetimes

2.11 Summary

3 NumPy Crash Course

3.1 Dimensions

3.2 The ndarray Object

3.2.1 Generating a Numeric Range with the arrange Method

3.2.2 Attributes on a ndarray Object

3.2.3 The reshape Method

3.2.4 The randint Function

3.2.5 The randn Function

3.3 The nan Object

3.4 Summary

Part 3: The Series

4 The Series Object

4.1 Overview of a Series

4.1.1 Modules, Classes and Instances

4.1.2 Populating the Series with Values

4.1.3 Customizing the Index

4.1.4 Creating a Series with Missing Values

4.2 Create a Series from Python Objects

4.2.1 Dictionaries

4.2.2 Tuples

4.2.3 Sets

4.2.4 NumPy Arrays

4.3 Retrieving the First and Last Rows

4.4 Mathematical Operations

4.4.1 Arithmetic Operations

4.4.2 Broadcasting

4.5 Passing the Series to Python’s Built-In Functions

4.6 Coding Challenges / Exercises

4.7 Summary

5 Series Methods

5.1 Importing a Dataset with the read_csv Method

5.2 Sorting a Series

5.2.1 Sorting by Values with the sort_values Method

5.2.2 Sorting by Index with the sort_index Method

5.2.3 Retrieving the Smallest and Largest Values with the nsmallest and nlargest Methods

5.3 Overwriting a Series with the inplace Parameter

5.4 Counting Values with the value_counts Method

5.5 Invoking a Function on Every Series Value with the apply Method

5.6 Coding Challenge: Deriving Insights from a Series

5.6.1 Problem

5.6.2 Solution

5.7 Summary

Part 4: The DataFrame

6 The DataFrame Object

6.1 Overview of a DataFrame

6.1.1 Creating A DataFrame from a Dictionary

6.1.2 Creating A DataFrame from a Numpy ndarray

6.2 Similarities between Series and DataFrames

6.2.1 Importing a CSV File with the read_csv Method

6.2.2 Shared and Exclusive Attributes between Series and DataFrames

6.2.3 Shared Methods between Series and DataFrames

6.3 Sorting a DataFrame

6.3.1 Sort by Single Column

6.3.2 Sort by Multiple Columns

6.4 Sort by Index

6.4.1 Sort by Row Index

6.4.2 Sort by Column Index

65 Setting a New Index

6.6 Selecting Columns or Rows from a DataFrame

6.6.1 Select a Single Column from a DataFrame

6.6.2 Select Multiple Columns from a DataFrame

6.7 Select Rows from a DataFrame

6.7.1 Extract Rows by Index Label

6.7.2 Extract Rows by Index Position

6.7.3 Extract Values from Specific Columns

6.8 Extract Value from Series

6.9 Rename Column or Row

6.10 Resetting an Index

6.11 Coding Challenge

6.12 Summary

7 Filtering a DataFrame

7.1 Optimizing A Dataset for Memory Usage

7.1.1 Converting Data Types with the as_type Method

7.2 Filtering by a Single Condition

7.3 Filtering by Multiple Conditions

7.3.1 The AND Condition

7.3.2 The OR Condition

7.3.3 Inversion with ~

7.3.4 Methods for Booleans

7.4 Filtering by Condition

7.4.1 The isin Method

7.4.2 The between Method

7.4.3 The isnull and notnull Methods

7.4.4 Dealing with Null Values

7.5 Dealing with Duplicates

7.5.1 The duplicated Method

7.5.2 The drop_duplicates Method

7.6 Coding Challenge

7.6.1 The Problem

7.6.2 Solutions

7.7 Summary

Part 5: Working with Text Data

8 Working with Text Data

8.1 String Casing

8.2 String Slicing

8.2.1 String Slicing and Character Replacement

8.3 Boolean Methods

8.4 Splitting Strings

8.5 Coding Challenge

8.6 A Note on Regular Expressions

8.7 Summary

Part 6: Grouping, Aggregating and Merging Data

9 MultiIndex DataFrames

9.1 The MultiIndex Object

9.2 MultiIndex DataFrames

9.3 Sorting A MultiIndex

9.4 Indexing with a MultiIndex

9.4.1 Extracting One or More Columns

9.4.2 Extracting One or More Rows with loc

9.4.3 Extracting One or More Rows with iloc

9.5 Cross Sections

9.6 Manipulating the Index

9.6.1 Resetting the Index

9.6.2 Setting the Index

9.7 Summary

10 Reshaping and Pivoting

10.1 Wide vs. Narrow Data

10.2 Creating a Pivot Table from a DataFrame

10.2.1 The pivot_table Method

10.2.2 Additional Options for Pivot Tables

10.3 Stacking and Unstacking Index Levels

10.4 Melting a Dataset

10.4.1 Melting a Dataset

10.5 Exploding a List of Values

10.6 Coding Challenge

10.7 Summary

11 The GroupBy Object

12 Merging, Joining and Concatenating

Part 7: Working with Dates and Times

13 Working with Dates and Times

Part 8: Input and Output

14 Imports and Exports

15 Configuring Pandas

Part 9: Visualization

16 Visualization

Appendixes

What's inside

  • Import a CSV, identify issues with its data structures, and convert it to the proper format
  • Sort, filter, pivot, and draw conclusions from a dataset and its subsets
  • Identify trends from text-based and time-based data
  • Organize, group, merge, and join separate datasets
  • Real-world datasets that are easy to download and explore

About the reader

For readers experienced with spreadsheet software who know the basics of Python.

About the author

Boris Paskhaver is a software engineer, Agile consultant, and educator. His six programming courses on Udemy have amassed 236,000 students, with an average course rating of 4.59 out of 5. He first used Python and the pandas library to derive a variety of business insights at the world’s #1 jobs site, Indeed.com.

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $35.99 $59.99 pBook + eBook + liveBook
Additional shipping charges may apply
Pandas in Action (print book) added to cart
continue shopping
go to cart

eBook $33.59 $47.99 3 formats + liveBook
Pandas in Action (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.

FREE domestic shipping on three or more pBooks