Skip to content

Commit

Permalink
Merge pull request #498 from realpython/seaborn-visualization
Browse files Browse the repository at this point in the history
seaborn
  • Loading branch information
KateFinegan authored Mar 8, 2024
2 parents ea3c2e7 + 195f835 commit e0ba527
Show file tree
Hide file tree
Showing 5 changed files with 1,659 additions and 0 deletions.
14 changes: 14 additions & 0 deletions seaborn-visualization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Visualizing Data In Python With Seaborn

This folder contains completed Jupyter notebooks and other files used in the Real Python tutorial on [Visualizing Data in Python With Seaborn](https://realpython.com/python-seaborn/).

None of the files are mandatory to complete the tutorial. However, you may find them of use to continue your learning by experimenting more with them.

## Available Files

- `tutorial.ipynb` is a Jupyter notebook containing all the code used in the tutorial, plus task solutions.
- `cereals_data.csv` contains the cereals data in CSV format.
- `cycle_crossings_apr_jun.csv` contains the cycle crossings data in CSV format.
- `tips.csv` is a local copy of the tips file available as a practice file from the seaborn developers.

Although you can complete the tutorial in a range of Python environments, using Jupyter Notebook within JupyterLab is highly recommended.
68 changes: 68 additions & 0 deletions seaborn-visualization/cereals_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name,manufacturer,calories,protein,fat,sodium,fiber,carbo,sugars,potass,vitamins,shelf,weight,cups,rating
Apple Cinnamon Cheerios,General Mills,110,2,2,180,1.5,10.5,10,70,25,1,1,0.75,29.509541
Basic 4,General Mills,130,3,2,210,2,18,8,100,25,3,1.33,0.75,37.038562
Cheerios,General Mills,110,6,2,290,2,17,1,105,25,1,1,1.25,50.764999
Cinnamon Toast Crunch,General Mills,120,1,3,210,0,13,9,45,25,2,1,0.75,19.823573
Clusters,General Mills,110,3,2,140,2,13,7,105,25,3,1,0.5,40.400208
Cocoa Puffs,General Mills,110,1,1,180,0,12,13,55,25,2,1,1,22.736446
Count Chocula,General Mills,110,1,1,180,0,12,13,65,25,2,1,1,22.396513
Crispy Wheat & Raisins,General Mills,100,2,1,140,2,11,10,120,25,3,1,0.75,36.176196
Golden Grahams,General Mills,110,1,1,280,0,15,9,45,25,2,1,0.75,23.804043
Honey Nut Cheerios,General Mills,110,3,1,250,1.5,11.5,10,90,25,1,1,0.75,31.072217
Kix,General Mills,110,2,1,260,0,21,3,40,25,2,1,1.5,39.241114
Lucky Charms,General Mills,110,2,1,180,0,12,12,55,25,2,1,1,26.734515
Multi-Grain Cheerios,General Mills,100,2,1,220,2,15,6,90,25,1,1,1,40.105965
Oatmeal Raisin Crisp,General Mills,130,3,2,170,1.5,13.5,10,120,25,3,1.25,0.5,30.450843
Raisin Nut Bran,General Mills,100,3,2,140,2.5,10.5,8,140,25,3,1,0.5,39.7034
Total Corn Flakes,General Mills,110,2,1,200,0,21,3,35,100,3,1,1,38.839746
Total Raisin Bran,General Mills,140,3,1,190,4,15,14,230,100,3,1.5,1,28.592785
Total Whole Grain,General Mills,100,3,1,200,3,16,3,110,100,3,1,1,46.658844
Triples,General Mills,110,2,1,250,0,21,3,60,25,3,1,0.75,39.106174
Trix,General Mills,110,1,1,140,0,13,12,25,25,2,1,1,27.753301
Wheaties,General Mills,100,3,1,200,3,17,3,110,25,1,1,1,51.592193
Wheaties Honey Gold,General Mills,110,2,1,200,1,16,8,60,25,1,1,0.75,36.187559
All-Bran,Kellogs,70,4,1,260,9,7,5,320,25,3,1,0.33,59.425505
All-Bran with Extra Fiber,Kellogs,50,4,0,140,14,8,0,330,25,3,1,0.5,93.704912
Apple Jacks,Kellogs,110,2,0,125,1,11,14,30,25,2,1,1,33.174094
Corn Flakes,Kellogs,100,2,0,290,1,21,2,35,25,1,1,1,45.863324
Corn Pops,Kellogs,110,1,0,90,1,13,12,20,25,2,1,1,35.782791
Cracklin' Oat Bran,Kellogs,110,3,3,140,4,10,7,160,25,3,1,0.5,40.448772
Crispix,Kellogs,110,2,0,220,1,21,3,30,25,3,1,1,46.895644
Froot Loops,Kellogs,110,2,1,125,1,11,13,30,25,2,1,1,32.207582
Frosted Flakes,Kellogs,110,1,0,200,1,14,11,25,25,1,1,0.75,31.435973
Frosted Mini-Wheats,Kellogs,100,3,0,0,3,14,7,100,25,2,1,0.8,58.345141
Fruitful Bran,Kellogs,120,3,0,240,5,14,12,190,25,3,1.33,0.67,41.015492
Just Right Crunchy Nuggets,Kellogs,110,2,1,170,1,17,6,60,100,3,1,1,36.523683
Just Right Fruit & Nut,Kellogs,140,3,1,170,2,20,9,95,100,3,1.3,0.75,36.471512
Mueslix Crispy Blend,Kellogs,160,3,2,150,3,17,13,160,25,3,1.5,0.67,30.313351
Nut&Honey Crunch,Kellogs,120,2,1,190,0,15,9,40,25,2,1,0.67,29.924285
Nutri-Grain Almond-Raisin,Kellogs,140,3,2,220,3,21,7,130,25,3,1.33,0.67,40.69232
Nutri-grain Wheat,Kellogs,90,3,0,170,3,18,2,90,25,3,1,1,59.642837
Product 19,Kellogs,100,3,0,320,1,20,3,45,100,3,1,1,41.50354
Raisin Bran,Kellogs,120,3,1,210,5,14,12,240,25,2,1.33,0.75,39.259197
Raisin Squares,Kellogs,90,2,0,0,2,15,6,110,25,3,1,0.5,55.333142
Rice Krispies,Kellogs,110,2,0,290,0,22,3,35,25,1,1,1,40.560159
Smacks,Kellogs,110,2,1,70,1,9,15,40,25,2,1,0.75,31.230054
Special K,Kellogs,110,6,0,230,1,16,3,55,25,1,1,1,53.131324
100% Bran,Nabisco,70,4,1,130,10,5,6,280,25,3,1,0.33,68.402973
Cream of Wheat (Quick),Nabisco,100,3,0,80,1,21,0,-1,0,2,1,1,64.533816
Shredded Wheat,Nabisco,80,2,0,0,3,16,0,95,0,1,0.83,1,68.235885
Shredded Wheat 'n'Bran,Nabisco,90,3,0,0,4,19,0,140,0,1,1,0.67,74.472949
Shredded Wheat spoon size,Nabisco,90,3,0,0,3,20,0,120,0,1,1,0.67,72.801787
Strawberry Fruit Wheats,Nabisco,90,2,0,15,3,15,5,90,25,2,1,1,59.363993
100% Natural Bran,Quaker Oats,120,3,5,15,2,8,8,135,0,3,1,1,33.983679
Cap'n'Crunch,Quaker Oats,120,1,2,220,0,12,12,35,25,2,1,0.75,18.042851
Honey Graham Ohs,Quaker Oats,120,1,2,220,1,12,11,45,25,2,1,1,21.871292
Life,Quaker Oats,100,4,2,150,2,12,6,95,25,2,1,0.67,45.328074
Puffed Rice,Quaker Oats,50,1,0,0,0,13,0,15,0,3,0.5,1,60.756112
Puffed Wheat,Quaker Oats,50,2,0,0,1,10,0,50,0,3,0.5,1,63.005645
Quaker Oat Squares,Quaker Oats,100,4,1,135,2,14,6,110,25,3,1,0.5,49.511874
Quaker Oatmeal,Quaker Oats,100,5,2,0,2.7,-1,-1,110,0,1,1,0.67,50.828392
Almond Delight,Ralston Purina,110,2,2,200,1,14,8,-1,25,3,1,0.75,34.384843
Bran Chex,Ralston Purina,90,2,1,200,4,15,6,125,25,1,1,0.67,49.120253
Corn Chex,Ralston Purina,110,2,0,280,0,22,3,25,25,1,1,1,41.445019
Double Chex,Ralston Purina,100,2,0,190,1,18,5,80,25,3,1,0.75,44.330856
Muesli Raisins; Dates; & Almonds,Ralston Purina,150,4,3,95,3,16,11,170,25,3,1,1,37.136863
Muesli Raisins; Peaches; & Pecans,Ralston Purina,150,4,3,150,3,16,11,170,25,3,1,1,34.139765
Rice Chex,Ralston Purina,110,1,0,240,0,23,2,30,25,1,1,1.13,41.998933
Wheat Chex,Ralston Purina,100,3,1,230,3,17,3,115,25,1,1,0.67,49.787445
92 changes: 92 additions & 0 deletions seaborn-visualization/cycle_crossings_apr_jun.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
date,day,month,max_temp,min_temp,precipitation,Brooklyn,Manhattan,Williamsburg,Queensboro
01/04/2017,Saturday,April,46,37,0,606,1446,1915,1430
02/04/2017,Sunday,April,62.1,41,0,2021,3943,4207,2862
03/04/2017,Monday,April,63,50,0.03,2470,4988,5178,3689
04/04/2017,Tuesday,April,51.1,46,1.18,723,1913,2279,1666
05/04/2017,Wednesday,April,63,46,0,2807,5276,5711,4197
06/04/2017,Thursday,April,48.9,41,0.73,461,1324,1739,1372
07/04/2017,Friday,April,48,43,0,1222,2955,3399,2765
08/04/2017,Saturday,April,55.9,39.9,0,1674,3163,4082,2691
09/04/2017,Sunday,April,66,45,0,2375,4377,4886,3261
10/04/2017,Monday,April,73.9,55,0,3324,6359,6881,4731
11/04/2017,Tuesday,April,80.1,62.1,0,3887,7247,8079,5501
12/04/2017,Wednesday,April,73.9,57.9,0.02,2565,5633,6620,4537
13/04/2017,Thursday,April,64,48.9,0,3353,6052,6775,4700
14/04/2017,Friday,April,64.9,48.9,0,2942,5054,5877,4142
15/04/2017,Saturday,April,64.9,52,0,2253,3853,4965,3291
16/04/2017,Sunday,April,84.9,62.1,0,2877,4585,5259,3687
17/04/2017,Monday,April,73.9,64,0,3152,6352,6924,4658
18/04/2017,Tuesday,April,66,50,0,3415,6691,7341,5012
19/04/2017,Wednesday,April,52,45,0,1965,4632,5234,3996
20/04/2017,Thursday,April,64.9,50,0.17,1567,3365,4302,3056
21/04/2017,Friday,April,53.1,48,0.29,1426,3142,3674,2672
22/04/2017,Saturday,April,55.9,52,0.11,1318,2297,2963,2366
23/04/2017,Sunday,April,64.9,46.9,0,2520,4681,5105,3434
24/04/2017,Monday,April,60.1,50,0,2544,5366,5762,4183
25/04/2017,Tuesday,April,54,50,0.91,611,1402,1902,1578
26/04/2017,Wednesday,April,59,54,0.34,1247,2774,3429,2369
27/04/2017,Thursday,April,68,59,0,2959,5311,6026,4285
28/04/2017,Friday,April,82.9,57.9,0,3679,6774,7196,5138
29/04/2017,Saturday,April,84,64,0.06,3315,5605,6045,4078
30/04/2017,Sunday,April,64,54,0,2225,4057,4513,3137
01/05/2017,Monday,May,72,50,0,3084,6506,6793,4820
02/05/2017,Tuesday,May,73.9,66.9,0,3423,7035,7789,5449
03/05/2017,Wednesday,May,64.9,57.9,0,3342,6984,7445,4804
04/05/2017,Thursday,May,63,50,0,3019,6525,6922,5144
05/05/2017,Friday,May,59,52,3.02,513,1471,1951,1421
06/05/2017,Saturday,May,64.9,57,0.18,1892,3815,5502,3965
07/05/2017,Sunday,May,54,48.9,0.01,3539,3547,4941,3851
08/05/2017,Monday,May,57,45,0,2886,5812,6249,4432
09/05/2017,Tuesday,May,61,48,0,2718,6455,6910,5000
10/05/2017,Wednesday,May,70,51.1,0,2810,6396,7075,4980
11/05/2017,Thursday,May,61,51.8,0,2657,6179,6750,5139
12/05/2017,Friday,May,62.1,51.1,0,2640,5367,6325,4692
13/05/2017,Saturday,May,51.1,45,1.31,151,484,874,865
14/05/2017,Sunday,May,64.9,46,0.02,1452,2704,3320,2389
15/05/2017,Monday,May,66.9,55.9,0,2685,5865,5981,4550
16/05/2017,Tuesday,May,78.1,57.9,0,3666,7847,8420,6209
17/05/2017,Wednesday,May,90,66,0,3535,7888,8540,6121
18/05/2017,Thursday,May,91.9,75,0,3190,6886,7645,5753
19/05/2017,Friday,May,90,75.9,0,2952,6432,6859,5272
20/05/2017,Saturday,May,64,55.9,0.01,2161,3896,5198,3910
21/05/2017,Sunday,May,66.9,55,0,2612,4656,5634,3782
22/05/2017,Monday,May,61,54,0.59,768,1633,2116,1609
23/05/2017,Tuesday,May,68,57.9,0,3174,6715,7011,4899
24/05/2017,Wednesday,May,66.9,57,0.04,2969,6005,6872,4344
25/05/2017,Thursday,May,57.9,55.9,0.58,488,1196,1789,1316
26/05/2017,Friday,May,73,55.9,0.1,2590,4563,5344,3642
27/05/2017,Saturday,May,71.1,61,0,2609,4013,6105,3703
28/05/2017,Sunday,May,71.1,59,0,2640,4048,5456,3549
29/05/2017,Monday,May,57.9,55.9,0.13,836,1730,2738,1704
30/05/2017,Tuesday,May,59,55.9,0.06,2301,5366,5938,4431
31/05/2017,Wednesday,May,75,57.9,0.03,2689,5717,6523,4575
01/06/2017,Thursday,June,78.1,62.1,0,3468,7328,8461,6184
02/06/2017,Friday,June,73.9,60.1,0.01,3271,7007,7968,5293
03/06/2017,Saturday,June,72,55,0.01,2589,4510,6210,4084
04/06/2017,Sunday,June,68,60.1,0.09,1805,3127,4023,3023
05/06/2017,Monday,June,66.9,60.1,0.02,2171,4552,5276,3359
06/06/2017,Tuesday,June,55.9,53.1,0.06,1193,3021,3807,2572
07/06/2017,Wednesday,June,66.9,54,0,3211,7180,7632,5072
08/06/2017,Thursday,June,68,59,0,3253,7083,7778,5288
09/06/2017,Friday,June,80.1,59,0,3401,6859,7744,5155
10/06/2017,Saturday,June,84,68,0,3066,5193,6391,4425
11/06/2017,Sunday,June,90,73,0,2465,4388,5153,3178
12/06/2017,Monday,June,91.9,77,0,2854,6265,7049,5032
13/06/2017,Tuesday,June,93.9,78.1,0,2882,6141,7155,5399
14/06/2017,Wednesday,June,84,69.1,0.29,2596,5630,6619,5152
15/06/2017,Thursday,June,75,66,0,3510,7854,8652,6344
16/06/2017,Friday,June,68,66,0,2054,4857,5783,4474
17/06/2017,Saturday,June,73,66.9,1.39,1399,2633,3439,2977
18/06/2017,Sunday,June,84,72,0,2199,4014,4901,3396
19/06/2017,Monday,June,87.1,70,1.35,1648,3553,4334,3552
20/06/2017,Tuesday,June,82,72,0.03,3407,7473,7975,6091
21/06/2017,Wednesday,June,82,72,0,3304,7416,8754,6159
22/06/2017,Thursday,June,82,70,0,3368,7624,8307,6289
23/06/2017,Friday,June,82.9,75.9,0.04,2283,4683,5611,4330
24/06/2017,Saturday,June,82.9,71.1,1.29,2307,3933,5214,3396
25/06/2017,Sunday,June,82,69.1,0,2625,4882,5727,4197
26/06/2017,Monday,June,78.1,66,0,3386,7217,7974,5845
27/06/2017,Tuesday,June,75.9,61,0.18,3182,7317,6501,5580
28/06/2017,Wednesday,June,78.1,62.1,0,3766,8239,8873,5834
29/06/2017,Thursday,June,81,68,0,3356,7544,8276,5662
30/06/2017,Friday,June,88,73.9,0,2687,5890,7013,4754
Loading

0 comments on commit e0ba527

Please sign in to comment.