Skip to content

Commit b35052c

Browse files
authored
Merge pull request #4 from stefmolin/versions-bump
Versions bump
2 parents d5cf5bb + 15fb316 commit b35052c

24 files changed

+1531
-1583
lines changed

.github/workflows/env-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
os: [macos-latest, ubuntu-latest, windows-latest]
41-
python-version: ["3.8", "3.9", "3.10"]
41+
python-version: ["3.8", "3.9", "3.10", "3.11"]
4242

4343
# Steps represent a sequence of tasks that will be executed as part of the job
4444
steps:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pandas Workshop
22

3-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stefmolin/pandas-workshop/main?urlpath=lab) [![Nbviewer](https://img.shields.io/badge/render-nbviewer-lightgrey?logo=jupyter)](https://nbviewer.jupyter.org/github/stefmolin/pandas-workshop/tree/main/) [![Env Build Workflow Status](https://img.shields.io/github/actions/workflow/status/stefmolin/pandas-workshop/env-checks.yml?label=env%20build&logo=github&logoColor=white)](https://github.com/stefmolin/pandas-workshop/actions/workflows/env-checks.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/stefmolin/pandas-workshop?logo=git&logoColor=white) [![View slides in browser](https://img.shields.io/badge/view-slides-orange?logo=reveal.js&logoColor=white)](https://stefmolin.github.io/pandas-workshop/slides/html/workshop.slides.html#/)
3+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stefmolin/pandas-workshop/main?urlpath=lab/tree/notebooks) [![Nbviewer](https://img.shields.io/badge/render-nbviewer-lightgrey?logo=jupyter)](https://nbviewer.jupyter.org/github/stefmolin/pandas-workshop/tree/main/) [![Env Build Workflow Status](https://img.shields.io/github/actions/workflow/status/stefmolin/pandas-workshop/env-checks.yml?label=env%20build&logo=github&logoColor=white)](https://github.com/stefmolin/pandas-workshop/actions/workflows/env-checks.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/stefmolin/pandas-workshop?logo=git&logoColor=white) [![View slides in browser](https://img.shields.io/badge/view-slides-orange?logo=reveal.js&logoColor=white)](https://stefmolin.github.io/pandas-workshop/slides/html/workshop.slides.html#/)
44

55
Working with data can be challenging: it often doesn’t come in the best format for analysis, and understanding it well enough to extract insights requires both time and the skills to filter, aggregate, reshape, and visualize it. This session will equip you with the knowledge you need to effectively use pandas – a powerful library for data analysis in Python – to make this process easier.
66

@@ -31,7 +31,7 @@ You should have basic knowledge of Python and be comfortable working in Jupyter
3131

3232
## Setup Instructions
3333

34-
0. Install Python >= version 3.8.0 and < version 3.11 OR install [Anaconda](https://docs.anaconda.com/anaconda/install/)/[Miniconda](https://docs.conda.io/en/latest/miniconda.html). Note that Anaconda/Miniconda is recommended if you are working on a Windows machine and are not very comfortable with the command line. Alternatively, you can use [this](https://mybinder.org/v2/gh/stefmolin/pandas-workshop/main?urlpath=lab) Binder environment if you don't want to install anything on your machine.
34+
0. Install Python >= version 3.8 and <= version 3.11 OR install [Anaconda](https://docs.anaconda.com/anaconda/install/)/[Miniconda](https://docs.conda.io/en/latest/miniconda.html). Note that Anaconda/Miniconda is recommended if you are working on a Windows machine and are not very comfortable with the command line. Alternatively, you can use [this](https://mybinder.org/v2/gh/stefmolin/pandas-workshop/main?urlpath=lab) Binder environment if you don't want to install anything on your machine.
3535
1. Fork this repository:
3636

3737
![location of fork button in GitHub](./images/fork_button.png)

asynchronous_lab/solutions.ipynb

Lines changed: 6 additions & 8 deletions
Large diffs are not rendered by default.

environment.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: pandas_workshop
22
channels:
33
- conda-forge
44
dependencies:
5-
- python>=3.8.0,<=3.10.15
5+
- python>=3.8.0,<=3.11.10
66
- jupyterlab=3.5.2
7-
- matplotlib=3.5.1
8-
- numpy=1.22.3
9-
- pandas=1.4.1
10-
- requests=2.27.1
11-
- scipy=1.8.0
12-
- seaborn=0.11.2
7+
- matplotlib=3.6.3
8+
- numpy=1.24.1
9+
- pandas=1.5.3
10+
- requests=2.28.2
11+
- seaborn=0.12.2

images/env_check.png

-5.59 KB
Loading

images/open_env_check_notebook.png

-2.05 KB
Loading

notebooks/0-check_your_env.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"\u001b[42m[ OK ]\u001b[0m numpy\n",
2424
"\u001b[42m[ OK ]\u001b[0m pandas\n",
2525
"\u001b[42m[ OK ]\u001b[0m requests\n",
26-
"\u001b[42m[ OK ]\u001b[0m scipy\n",
2726
"\u001b[42m[ OK ]\u001b[0m seaborn\n"
2827
]
2928
}
@@ -57,7 +56,7 @@
5756
"name": "python",
5857
"nbconvert_exporter": "python",
5958
"pygments_lexer": "ipython3",
60-
"version": "3.10.8"
59+
"version": "3.11.0"
6160
}
6261
},
6362
"nbformat": 4,

notebooks/1-getting_started_with_pandas.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"tags": []
1111
},
1212
"source": [
13-
"[![View slides in browser](https://img.shields.io/badge/view-slides-orange?logo=reveal.js&logoColor=white)](https://stefmolin.github.io/pandas-workshop/slides/html/workshop.slides.html#/section-1)\n",
13+
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stefmolin/pandas-workshop/main?urlpath=lab/tree/notebooks/1-getting_started_with_pandas.ipynb) [![View slides in browser](https://img.shields.io/badge/view-slides-orange?logo=reveal.js&logoColor=white)](https://stefmolin.github.io/pandas-workshop/slides/html/workshop.slides.html#/section-1)\n",
1414
"\n",
1515
"---\n",
1616
"\n"
@@ -2612,7 +2612,7 @@
26122612
"name": "python",
26132613
"nbconvert_exporter": "python",
26142614
"pygments_lexer": "ipython3",
2615-
"version": "3.10.8"
2615+
"version": "3.11.0"
26162616
}
26172617
},
26182618
"nbformat": 4,

notebooks/2-data_wrangling.ipynb

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"tags": []
1111
},
1212
"source": [
13-
"[![View slides in browser](https://img.shields.io/badge/view-slides-orange?logo=reveal.js&logoColor=white)](https://stefmolin.github.io/pandas-workshop/slides/html/workshop.slides.html#/section-2)\n",
13+
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stefmolin/pandas-workshop/main?urlpath=lab/tree/notebooks/2-data_wrangling.ipynb) [![View slides in browser](https://img.shields.io/badge/view-slides-orange?logo=reveal.js&logoColor=white)](https://stefmolin.github.io/pandas-workshop/slides/html/workshop.slides.html#/section-2)\n",
1414
"\n",
1515
"---\n",
1616
"\n"
@@ -518,29 +518,15 @@
518518
}
519519
],
520520
"source": [
521-
"taxis.rename(\n",
521+
"taxis = taxis.rename(\n",
522522
" columns={\n",
523523
" 'tpep_pickup_datetime': 'pickup', \n",
524524
" 'tpep_dropoff_datetime': 'dropoff'\n",
525-
" },\n",
526-
" inplace=True\n",
525+
" }\n",
527526
")\n",
528527
"taxis.columns"
529528
]
530529
},
531-
{
532-
"cell_type": "markdown",
533-
"id": "5c28403d-34f9-4c9c-a61e-3ad43a30e0dc",
534-
"metadata": {
535-
"slideshow": {
536-
"slide_type": "fragment"
537-
},
538-
"tags": []
539-
},
540-
"source": [
541-
"**Important**: This operation was performed in-place &ndash; be careful with in-place operations."
542-
]
543-
},
544530
{
545531
"cell_type": "markdown",
546532
"id": "d74d21a8-d733-4afa-a140-29ccdcd83b46",
@@ -634,8 +620,8 @@
634620
}
635621
],
636622
"source": [
637-
"taxis.loc[:, ['pickup', 'dropoff']] = \\\n",
638-
" taxis.loc[:, ['pickup', 'dropoff']].apply(pd.to_datetime)\n",
623+
"taxis[['pickup', 'dropoff']] = \\\n",
624+
" taxis[['pickup', 'dropoff']].apply(pd.to_datetime)\n",
639625
"taxis.dtypes"
640626
]
641627
},
@@ -1440,7 +1426,7 @@
14401426
}
14411427
],
14421428
"source": [
1443-
"taxis.set_index('pickup', inplace=True)\n",
1429+
"taxis = taxis.set_index('pickup')\n",
14441430
"taxis.head(3)"
14451431
]
14461432
},
@@ -1464,7 +1450,7 @@
14641450
"metadata": {},
14651451
"outputs": [],
14661452
"source": [
1467-
"taxis.sort_index(inplace=True)"
1453+
"taxis = taxis.sort_index()"
14681454
]
14691455
},
14701456
{
@@ -2033,7 +2019,7 @@
20332019
}
20342020
],
20352021
"source": [
2036-
"taxis.reset_index(inplace=True)\n",
2022+
"taxis = taxis.reset_index()\n",
20372023
"taxis.head()"
20382024
]
20392025
},
@@ -4594,8 +4580,7 @@
45944580
"metadata": {},
45954581
"outputs": [],
45964582
"source": [
4597-
"taxis.set_index('dropoff', inplace=True)\n",
4598-
"taxis.sort_index(inplace=True)"
4583+
"taxis = taxis.set_index('dropoff').sort_index()"
45994584
]
46004585
},
46014586
{
@@ -5392,7 +5377,7 @@
53925377
"metadata": {},
53935378
"outputs": [],
53945379
"source": [
5395-
"tsa_melted_holiday_travel.set_index('date', inplace=True)"
5380+
"tsa_melted_holiday_travel = tsa_melted_holiday_travel.set_index('date')"
53965381
]
53975382
},
53985383
{
@@ -5969,7 +5954,7 @@
59695954
" <dc:format>image/svg+xml</dc:format>\n",
59705955
" <dc:creator>\n",
59715956
" <cc:Agent>\n",
5972-
" <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n",
5957+
" <dc:title>Matplotlib v3.6.3, https://matplotlib.org/</dc:title>\n",
59735958
" </cc:Agent>\n",
59745959
" </dc:creator>\n",
59755960
" </cc:Work>\n",
@@ -6010,7 +5995,7 @@
60105995
" </g>\n",
60115996
" <g id=\"text_1\">\n",
60125997
" <!-- 2020-01 -->\n",
6013-
" <g transform=\"translate(22.789156 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
5998+
" <g transform=\"translate(22.789156 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
60145999
" <defs>\n",
60156000
" <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
60166001
"L 3431 531 \n",
@@ -6097,7 +6082,7 @@
60976082
" </g>\n",
60986083
" <g id=\"text_2\">\n",
60996084
" <!-- 2020-03 -->\n",
6100-
" <g transform=\"translate(76.157027 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
6085+
" <g transform=\"translate(76.157027 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
61016086
" <defs>\n",
61026087
" <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \n",
61036088
"Q 3050 2419 3304 2112 \n",
@@ -6150,7 +6135,7 @@
61506135
" </g>\n",
61516136
" <g id=\"text_3\">\n",
61526137
" <!-- 2020-05 -->\n",
6153-
" <g transform=\"translate(130.414362 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
6138+
" <g transform=\"translate(130.414362 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
61546139
" <defs>\n",
61556140
" <path id=\"DejaVuSans-35\" d=\"M 691 4666 \n",
61566141
"L 3169 4666 \n",
@@ -6196,7 +6181,7 @@
61966181
" </g>\n",
61976182
" <g id=\"text_4\">\n",
61986183
" <!-- 2020-07 -->\n",
6199-
" <g transform=\"translate(184.671697 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
6184+
" <g transform=\"translate(184.671697 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
62006185
" <defs>\n",
62016186
" <path id=\"DejaVuSans-37\" d=\"M 525 4666 \n",
62026187
"L 3525 4666 \n",
@@ -6227,7 +6212,7 @@
62276212
" </g>\n",
62286213
" <g id=\"text_5\">\n",
62296214
" <!-- 2020-09 -->\n",
6230-
" <g transform=\"translate(239.818496 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
6215+
" <g transform=\"translate(239.818496 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
62316216
" <defs>\n",
62326217
" <path id=\"DejaVuSans-39\" d=\"M 703 97 \n",
62336218
"L 703 672 \n",
@@ -6278,7 +6263,7 @@
62786263
" </g>\n",
62796264
" <g id=\"text_6\">\n",
62806265
" <!-- 2020-11 -->\n",
6281-
" <g transform=\"translate(294.075831 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
6266+
" <g transform=\"translate(294.075831 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
62826267
" <use xlink:href=\"#DejaVuSans-32\"/>\n",
62836268
" <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
62846269
" <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
@@ -6297,7 +6282,7 @@
62976282
" </g>\n",
62986283
" <g id=\"text_7\">\n",
62996284
" <!-- 2021-01 -->\n",
6300-
" <g transform=\"translate(348.333166 291.797971)rotate(-30)scale(0.1 -0.1)\">\n",
6285+
" <g transform=\"translate(348.333166 291.797971) rotate(-30) scale(0.1 -0.1)\">\n",
63016286
" <use xlink:href=\"#DejaVuSans-32\"/>\n",
63026287
" <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
63036288
" <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
@@ -6310,7 +6295,7 @@
63106295
" </g>\n",
63116296
" <g id=\"text_8\">\n",
63126297
" <!-- date -->\n",
6313-
" <g transform=\"translate(211.06625 305.197471)scale(0.1 -0.1)\">\n",
6298+
" <g transform=\"translate(211.06625 305.197471) scale(0.1 -0.1)\">\n",
63146299
" <defs>\n",
63156300
" <path id=\"DejaVuSans-64\" d=\"M 2906 2969 \n",
63166301
"L 2906 4863 \n",
@@ -6439,7 +6424,7 @@
64396424
" </g>\n",
64406425
" <g id=\"text_9\">\n",
64416426
" <!-- 0.0 -->\n",
6442-
" <g transform=\"translate(20.878125 258.170709)scale(0.1 -0.1)\">\n",
6427+
" <g transform=\"translate(20.878125 258.170709) scale(0.1 -0.1)\">\n",
64436428
" <defs>\n",
64446429
" <path id=\"DejaVuSans-2e\" d=\"M 684 794 \n",
64456430
"L 1344 794 \n",
@@ -6463,7 +6448,7 @@
64636448
" </g>\n",
64646449
" <g id=\"text_10\">\n",
64656450
" <!-- 0.5 -->\n",
6466-
" <g transform=\"translate(20.878125 214.030447)scale(0.1 -0.1)\">\n",
6451+
" <g transform=\"translate(20.878125 214.030447) scale(0.1 -0.1)\">\n",
64676452
" <use xlink:href=\"#DejaVuSans-30\"/>\n",
64686453
" <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
64696454
" <use xlink:href=\"#DejaVuSans-35\" x=\"95.410156\"/>\n",
@@ -6478,7 +6463,7 @@
64786463
" </g>\n",
64796464
" <g id=\"text_11\">\n",
64806465
" <!-- 1.0 -->\n",
6481-
" <g transform=\"translate(20.878125 169.890185)scale(0.1 -0.1)\">\n",
6466+
" <g transform=\"translate(20.878125 169.890185) scale(0.1 -0.1)\">\n",
64826467
" <use xlink:href=\"#DejaVuSans-31\"/>\n",
64836468
" <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
64846469
" <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
@@ -6493,7 +6478,7 @@
64936478
" </g>\n",
64946479
" <g id=\"text_12\">\n",
64956480
" <!-- 1.5 -->\n",
6496-
" <g transform=\"translate(20.878125 125.749923)scale(0.1 -0.1)\">\n",
6481+
" <g transform=\"translate(20.878125 125.749923) scale(0.1 -0.1)\">\n",
64976482
" <use xlink:href=\"#DejaVuSans-31\"/>\n",
64986483
" <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
64996484
" <use xlink:href=\"#DejaVuSans-35\" x=\"95.410156\"/>\n",
@@ -6508,7 +6493,7 @@
65086493
" </g>\n",
65096494
" <g id=\"text_13\">\n",
65106495
" <!-- 2.0 -->\n",
6511-
" <g transform=\"translate(20.878125 81.60966)scale(0.1 -0.1)\">\n",
6496+
" <g transform=\"translate(20.878125 81.60966) scale(0.1 -0.1)\">\n",
65126497
" <use xlink:href=\"#DejaVuSans-32\"/>\n",
65136498
" <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
65146499
" <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
@@ -6523,7 +6508,7 @@
65236508
" </g>\n",
65246509
" <g id=\"text_14\">\n",
65256510
" <!-- 2.5 -->\n",
6526-
" <g transform=\"translate(20.878125 37.469398)scale(0.1 -0.1)\">\n",
6511+
" <g transform=\"translate(20.878125 37.469398) scale(0.1 -0.1)\">\n",
65276512
" <use xlink:href=\"#DejaVuSans-32\"/>\n",
65286513
" <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
65296514
" <use xlink:href=\"#DejaVuSans-35\" x=\"95.410156\"/>\n",
@@ -6532,7 +6517,7 @@
65326517
" </g>\n",
65336518
" <g id=\"text_15\">\n",
65346519
" <!-- travelers -->\n",
6535-
" <g transform=\"translate(14.798438 162.063531)rotate(-90)scale(0.1 -0.1)\">\n",
6520+
" <g transform=\"translate(14.798438 162.063531) rotate(-90) scale(0.1 -0.1)\">\n",
65366521
" <defs>\n",
65376522
" <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
65386523
"Q 2534 3019 2420 3045 \n",
@@ -6613,7 +6598,7 @@
66136598
" </g>\n",
66146599
" <g id=\"text_16\">\n",
66156600
" <!-- 1e6 -->\n",
6616-
" <g transform=\"translate(43.78125 19.318125)scale(0.1 -0.1)\">\n",
6601+
" <g transform=\"translate(43.78125 19.318125) scale(0.1 -0.1)\">\n",
66176602
" <defs>\n",
66186603
" <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
66196604
"Q 1688 2584 1439 2293 \n",
@@ -7439,7 +7424,7 @@
74397424
" </g>\n",
74407425
" <g id=\"text_17\">\n",
74417426
" <!-- 2020 TSA Traveler Throughput -->\n",
7442-
" <g transform=\"translate(130.820625 16.318125)scale(0.12 -0.12)\">\n",
7427+
" <g transform=\"translate(130.820625 16.318125) scale(0.12 -0.12)\">\n",
74437428
" <defs>\n",
74447429
" <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n",
74457430
" <path id=\"DejaVuSans-54\" d=\"M -19 4666 \n",
@@ -7675,7 +7660,7 @@
76757660
" </g>\n",
76767661
" <g id=\"text_18\">\n",
76777662
" <!-- travelers -->\n",
7678-
" <g transform=\"translate(340.448125 38.916562)scale(0.1 -0.1)\">\n",
7663+
" <g transform=\"translate(340.448125 38.916562) scale(0.1 -0.1)\">\n",
76797664
" <use xlink:href=\"#DejaVuSans-74\"/>\n",
76807665
" <use xlink:href=\"#DejaVuSans-72\" x=\"39.208984\"/>\n",
76817666
" <use xlink:href=\"#DejaVuSans-61\" x=\"80.322266\"/>\n",
@@ -7695,7 +7680,7 @@
76957680
" </g>\n",
76967681
" <g id=\"text_19\">\n",
76977682
" <!-- 7D MA -->\n",
7698-
" <g transform=\"translate(340.448125 53.594688)scale(0.1 -0.1)\">\n",
7683+
" <g transform=\"translate(340.448125 53.594688) scale(0.1 -0.1)\">\n",
76997684
" <defs>\n",
77007685
" <path id=\"DejaVuSans-44\" d=\"M 1259 4147 \n",
77017686
"L 1259 519 \n",
@@ -7748,7 +7733,7 @@
77487733
" </g>\n",
77497734
" <g id=\"text_20\">\n",
77507735
" <!-- YTD mean -->\n",
7751-
" <g transform=\"translate(340.448125 68.272812)scale(0.1 -0.1)\">\n",
7736+
" <g transform=\"translate(340.448125 68.272812) scale(0.1 -0.1)\">\n",
77527737
" <defs>\n",
77537738
" <path id=\"DejaVuSans-59\" d=\"M -13 4666 \n",
77547739
"L 666 4666 \n",
@@ -7915,7 +7900,7 @@
79157900
"name": "python",
79167901
"nbconvert_exporter": "python",
79177902
"pygments_lexer": "ipython3",
7918-
"version": "3.10.8"
7903+
"version": "3.11.0"
79197904
}
79207905
},
79217906
"nbformat": 4,

0 commit comments

Comments
 (0)