Skip to content

Commit 023e11b

Browse files
committed
add colab link
1 parent 96eb9cd commit 023e11b

File tree

1 file changed

+41
-30
lines changed

1 file changed

+41
-30
lines changed

day_12/seaborn.ipynb

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,25 @@
55
"colab": {
66
"name": "seaborn.ipynb",
77
"provenance": [],
8-
"collapsed_sections": []
8+
"collapsed_sections": [],
9+
"include_colab_link": true
910
},
1011
"kernelspec": {
1112
"name": "python3",
1213
"display_name": "Python 3"
1314
}
1415
},
1516
"cells": [
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {
20+
"id": "view-in-github",
21+
"colab_type": "text"
22+
},
23+
"source": [
24+
"<a href=\"https://colab.research.google.com/github/gumdropsteve/intro_to_python/blob/main/day_12/seaborn.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
25+
]
26+
},
1627
{
1728
"cell_type": "code",
1829
"metadata": {
@@ -24,7 +35,7 @@
2435
"import matplotlib.pyplot as plt\n",
2536
"import numpy as np"
2637
],
27-
"execution_count": 157,
38+
"execution_count": null,
2839
"outputs": []
2940
},
3041
{
@@ -42,7 +53,7 @@
4253
"df = sns.load_dataset(\"titanic\")\n",
4354
"df.head()"
4455
],
45-
"execution_count": 158,
56+
"execution_count": null,
4657
"outputs": [
4758
{
4859
"output_type": "execute_result",
@@ -209,7 +220,7 @@
209220
"# Look at dtypes and NaN \n",
210221
"df.info()"
211222
],
212-
"execution_count": 159,
223+
"execution_count": null,
213224
"outputs": [
214225
{
215226
"output_type": "stream",
@@ -254,7 +265,7 @@
254265
"# How many NaN values in each column\n",
255266
"df.isnull().sum()"
256267
],
257-
"execution_count": 160,
268+
"execution_count": null,
258269
"outputs": [
259270
{
260271
"output_type": "execute_result",
@@ -298,7 +309,7 @@
298309
"# Finding the mean of a column\n",
299310
"df[\"age\"].mean()"
300311
],
301-
"execution_count": 161,
312+
"execution_count": null,
302313
"outputs": [
303314
{
304315
"output_type": "execute_result",
@@ -328,7 +339,7 @@
328339
"# Describe shows a lot of useful summary statistics\n",
329340
"df.describe()"
330341
],
331-
"execution_count": 162,
342+
"execution_count": null,
332343
"outputs": [
333344
{
334345
"output_type": "execute_result",
@@ -469,7 +480,7 @@
469480
"# Look at NaN values in deck column\n",
470481
"df[\"deck\"]"
471482
],
472-
"execution_count": 163,
483+
"execution_count": null,
473484
"outputs": [
474485
{
475486
"output_type": "execute_result",
@@ -514,7 +525,7 @@
514525
"\n",
515526
"df[[\"age\"]][:19].fillna(age_med)"
516527
],
517-
"execution_count": 165,
528+
"execution_count": null,
518529
"outputs": [
519530
{
520531
"output_type": "stream",
@@ -673,7 +684,7 @@
673684
"# Backfill NaN values\n",
674685
"df[[\"age\"]][:19].fillna(method=\"bfill\")"
675686
],
676-
"execution_count": 166,
687+
"execution_count": null,
677688
"outputs": [
678689
{
679690
"output_type": "stream",
@@ -832,7 +843,7 @@
832843
"# Forward fill NaN values\n",
833844
"df[[\"age\"]][:19].fillna(method=\"ffill\")"
834845
],
835-
"execution_count": 167,
846+
"execution_count": null,
836847
"outputs": [
837848
{
838849
"output_type": "execute_result",
@@ -986,7 +997,7 @@
986997
" df[\"age\"]\n",
987998
")"
988999
],
989-
"execution_count": 14,
1000+
"execution_count": null,
9901001
"outputs": [
9911002
{
9921003
"output_type": "execute_result",
@@ -1031,7 +1042,7 @@
10311042
"\n",
10321043
"sns.histplot(df[\"age\"])"
10331044
],
1034-
"execution_count": 37,
1045+
"execution_count": null,
10351046
"outputs": [
10361047
{
10371048
"output_type": "execute_result",
@@ -1087,7 +1098,7 @@
10871098
"df.columns = col_title\n",
10881099
"df.head()"
10891100
],
1090-
"execution_count": 168,
1101+
"execution_count": null,
10911102
"outputs": [
10921103
{
10931104
"output_type": "execute_result",
@@ -1232,7 +1243,7 @@
12321243
"# Create a new column and change the datatype\n",
12331244
"df[\"Survived String\"] = df[\"Survived\"].astype(\"str\")"
12341245
],
1235-
"execution_count": 54,
1246+
"execution_count": null,
12361247
"outputs": []
12371248
},
12381249
{
@@ -1261,7 +1272,7 @@
12611272
"g.despine(left=True)\n",
12621273
"plt.title(\"Survival on the Titanic Separated by Class\");"
12631274
],
1264-
"execution_count": 169,
1275+
"execution_count": null,
12651276
"outputs": [
12661277
{
12671278
"output_type": "display_data",
@@ -1293,7 +1304,7 @@
12931304
"sns.histplot(df[\"Age\"])\n",
12941305
"sns.histplot(df[\"Fare\"])"
12951306
],
1296-
"execution_count": 94,
1307+
"execution_count": null,
12971308
"outputs": [
12981309
{
12991310
"output_type": "execute_result",
@@ -1338,7 +1349,7 @@
13381349
"sns.histplot(df[df[\"Class\"] == \"Second\"][\"Age\"])\n",
13391350
"sns.histplot(df[df[\"Class\"] == \"Third\"][\"Age\"])"
13401351
],
1341-
"execution_count": 170,
1352+
"execution_count": null,
13421353
"outputs": [
13431354
{
13441355
"output_type": "execute_result",
@@ -1389,7 +1400,7 @@
13891400
"plt.legend(labels=[\"First Class\", \"Second Class\", \"Third Class\"])\n",
13901401
"plt.title(\"KDE Plot of Fares grouped by class\");"
13911402
],
1392-
"execution_count": 180,
1403+
"execution_count": null,
13931404
"outputs": [
13941405
{
13951406
"output_type": "display_data",
@@ -1428,7 +1439,7 @@
14281439
"plt.legend(labels=[\"First Class\", \"Second Class\", \"Third Class\"])\n",
14291440
"plt.title(\"KDE Plot of Fares grouped by class\");"
14301441
],
1431-
"execution_count": 182,
1442+
"execution_count": null,
14321443
"outputs": [
14331444
{
14341445
"output_type": "display_data",
@@ -1471,7 +1482,7 @@
14711482
"\n",
14721483
"make_kde(df)"
14731484
],
1474-
"execution_count": 179,
1485+
"execution_count": null,
14751486
"outputs": [
14761487
{
14771488
"output_type": "display_data",
@@ -1500,7 +1511,7 @@
15001511
"source": [
15011512
"df[\"Class\"].value_counts()"
15021513
],
1503-
"execution_count": 95,
1514+
"execution_count": null,
15041515
"outputs": [
15051516
{
15061517
"output_type": "execute_result",
@@ -1534,7 +1545,7 @@
15341545
"sns.pairplot(df, hue=\"Class\")\n",
15351546
"plt.title(\"Pairplot of Columns in Titanic Dataset\")"
15361547
],
1537-
"execution_count": 121,
1548+
"execution_count": null,
15381549
"outputs": [
15391550
{
15401551
"output_type": "stream",
@@ -1594,7 +1605,7 @@
15941605
"ax.set(ylabel=\"\")\n",
15951606
"plt.title(\"Swarmplot\")"
15961607
],
1597-
"execution_count": 127,
1608+
"execution_count": null,
15981609
"outputs": [
15991610
{
16001611
"output_type": "stream",
@@ -1659,7 +1670,7 @@
16591670
"\n",
16601671
"plt.title(\"Survival Violin Plot\");"
16611672
],
1662-
"execution_count": 130,
1673+
"execution_count": null,
16631674
"outputs": [
16641675
{
16651676
"output_type": "display_data",
@@ -1689,7 +1700,7 @@
16891700
"# Find min value of fare\n",
16901701
"df[\"Fare\"].min()"
16911702
],
1692-
"execution_count": 131,
1703+
"execution_count": null,
16931704
"outputs": [
16941705
{
16951706
"output_type": "execute_result",
@@ -1718,7 +1729,7 @@
17181729
"# Find max value of fare\n",
17191730
"df[[\"Fare\"]].max()"
17201731
],
1721-
"execution_count": 135,
1732+
"execution_count": null,
17221733
"outputs": [
17231734
{
17241735
"output_type": "execute_result",
@@ -1748,7 +1759,7 @@
17481759
"# Whar methods can we use with a pandas dataframe object\n",
17491760
"dir(df[[\"Fare\"]])"
17501761
],
1751-
"execution_count": 134,
1762+
"execution_count": null,
17521763
"outputs": [
17531764
{
17541765
"output_type": "execute_result",
@@ -2213,7 +2224,7 @@
22132224
" # multiple=\"fill\", # Look up what fill is doing with a kdeplot with multiple classes\n",
22142225
")"
22152226
],
2216-
"execution_count": 155,
2227+
"execution_count": null,
22172228
"outputs": [
22182229
{
22192230
"output_type": "execute_result",
@@ -2256,7 +2267,7 @@
22562267
"# Seeing which class was represented the most in the data\n",
22572268
"df[\"Class\"].value_counts().plot(kind=\"bar\", figsize=(10,10))"
22582269
],
2259-
"execution_count": 152,
2270+
"execution_count": null,
22602271
"outputs": [
22612272
{
22622273
"output_type": "execute_result",

0 commit comments

Comments
 (0)