Free

Data Analysis with pandas

The summary statistic you choose is an argument, not a neutral fact.

  • Python
  • pandas
  • Matplotlib

About this project

A pandas analysis over a year of retail sales, producing summary tables and four saved charts. The data is synthetic — generated by a script with a distribution we chose — and the project says so in its own output rather than implying it is real trading data.

The idea it is built around is that the summary statistic you pick is an argument. On this data the mean order is about six times the median, because a handful of bulk orders drag it upward; only about one order in seven is as large as the "average" order. Print the mean alone and you have described a shop that does not exist. The project prints both on the same column and lets the gap make the point, including the moment where mean minus one standard deviation gives a negative order value — correct arithmetic, meaningless summary.

The charts carry the same theme. The same city comparison is drawn twice, once from a zero baseline and once from a truncated axis, and the script prints the measured exaggeration between them. One chart is labelled misleading on purpose.

What you will learn

  • Group, aggregate and pivot with pandas rather than looping over rows
  • Choose between mean and median on skewed data, and justify the choice
  • Read skew and standard deviation, and notice when a summary has stopped describing anything
  • Draw the same data honestly and misleadingly, and see how much a truncated axis changes it
  • Save charts to PNG from a script, so the analysis is repeatable rather than clicked

Before you start

  • Python basics — functions, lists and dictionaries
  • Python 3.10 or newer, plus pandas and matplotlib (one pip command)

New to Python? The free Python course covers everything this project assumes.

Academic integrity notice

These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.