Data analysis by topic
43 posts about working with data in Python — Pandas, SQL, and Jupyter — organized by topic.
Pandas
Pandas is the Python library for working with tabular data, and these posts cover reading CSV and Excel files, datetime indexing, memory usage, plotting, new Pandas 3 features, and practice exercises.
- Free real-world Pandas exercises, with solutions
- New: In-browser Python/Pandas/Git exercises, with AI support
- Pandas groupby agg: Applying multiple aggregations at once
- Pandas na_values: Treating custom strings as missing data
- Pandas loc vs iloc slicing: Inclusive vs exclusive endpoints
- pandas read_csv: Speed up loading with the PyArrow engine
- Pandas category dtype: Reduce string column memory by 90%
- Python str.split and rsplit: Splitting strings with maxsplit
- Pandas columns overlap error: Fixing join with lsuffix and rsuffix
- Pandas join: Why you need a one-column DataFrame, not a Series
- Pandas currency strings: Strip USD, then astype(float) and sum
- Pandas 3.0 pd.col: Replacing lambda in loc and assign
- What’s new in Pandas 3?
- Pandas Series and DataFrame methods: same names, column-wise results
- Reading multi-sheet Excel files in Pandas with sheet_name
- Pandas memory usage: Why you need deep=True for text columns
- Pandas read_csv accepts a URL: Loading remote data files
- Saving a Pandas plot to a file with get_figure and savefig
- Pandas datetime index slicing: sort_index to avoid a KeyError
- Pandas nlargest: Finding top rows faster than sort_values
- Pandas column arguments: Where one name works, a list does too
- Pandas sort_values: Sorting a data frame by multiple columns
- Pandas select_dtypes: Selecting columns by their dtype
- Jupyter memory usage: Why del doesn’t free your DataFrame
- Your personal mentor for Python and Pandas
- Sharpen your Pandas skills with “Bamboo Weekly”
- Upcoming Python/Pandas courses for seasoned coders
- Lots of new YouTube videos about Python and Pandas!
- Improve your “pandas” skills with “Pandas Workout”
- Summary of my “reduce” series
- Understanding “reduce” (first in a series)
PostgreSQL & SQL
PostgreSQL is an open-source relational database queried with SQL, and these posts cover its array type, regular expressions, NULL comparisons, quoting rules, transaction commits, and how SQL thinking clarifies Python comprehensions.
- Using regexps in PostgreSQL
- In PostgreSQL, as in life, don’t wait too long to commit
- Want to understand Python’s comprehensions? Think in Excel or SQL.
- Remember: Don’t mix = and NULL
- Turning a PostgreSQL array to rows
- Turning PostgreSQL rows into arrays
- Looking in PostgreSQL arrays with ANY
- PostgreSQL array indexes and length
- Learning to love PostgreSQL arrays
- Don’t use double quotes in PostgreSQL
Jupyter & notebooks
Jupyter notebooks let you run Python interactively in the browser, mixing code, output, and notes; these posts cover setting up a notebook server, sharing notebooks, and why deleting a DataFrame doesn't reclaim memory.
