A Taste of Data Analysis
Try the most common Python job after class: making sense of data. You'll load a coffee chain's sales into a pandas table, look at what's in it, total the sales by store, and draw a bar chart someone else can read. The chapter ends with where to go next if you'd like to do this for real.
Updated
pandas, a First Look
- Your First pandas Table (Apprentice): pandas reads a whole CSV file into a DataFrame, a table you can ask questions, and a few lines then show what's in it, pick out a column, keep the rows that match a condition and total a column for each group.
- Your First Chart (Apprentice): A bar chart shows at a glance what a column of numbers makes you read digit by digit, and matplotlib draws one in a few lines, with a title and axis labels so the reader knows what it shows, saved as an image file with savefig.
Exercise: Coffee Sales at a Glance
- Exercise: Coffee Sales at a Glance (Apprentice): Answer a coffee chain owner's three questions about a month of sales with pandas and matplotlib, by writing four functions that load the data, total each store, find the busiest day and save a labeled bar chart, and let pytest's tests check each one.