Skip to content

Python For Data Science Textbook

A free, self-paced textbook in 7 chapters. Read a chapter, then drill it with the 100 companion flashcards using spaced repetition.

7 chapters · 100 cards · Updated

Chapters

  1. 1NumPy Essentials

    NumPy is the foundational library for numerical computing in Python, and it revolves around the ndarray object. Arrays can be created from existing Python lists using np.array([1,...

  2. 2Pandas DataFrames and Selection

    Pandas builds on NumPy to provide labeled, tabular data structures ideal for data analysis. The primary object is the DataFrame, which can be created directly from a dictionary suc...

  3. 3Data Cleaning and Type Handling

    Real-world data is messy, and Pandas offers a rich toolkit for cleaning it. Duplicate rows can be flagged with df.duplicated(), which returns a boolean Series marking every row aft...

  4. 4Data Visualization with Matplotlib and Seaborn

    Matplotlib is the workhorse plotting library underlying most Python visualization. A basic line plot is created with plt.plot(x, y) followed by plt.show(). Before displaying, you c...

  5. 5Aggregation, Merging, and Reshaping

    Group-based aggregation is central to data analysis, and Pandas implements the familiar split-apply-combine pattern through groupby. The expression df.groupby('category')['value']....

  6. 6Feature Engineering and Preprocessing

    Before feeding data to machine-learning models, raw columns usually need to be transformed into more informative features. The simplest step is creating new columns through vectori...

  7. 7Data Inspection and Jupyter Productivity

    Before any serious analysis, you need a quick overview of a DataFrame. df.shape returns a tuple of (rows, columns), df.head(10) shows the first ten rows, and df.dtypes lists the da...

← Back to the Python For Data Science deck