Skip to content

Commit 3525c03

Browse files
committed
Code Bundle updated
1 parent 201bd7c commit 3525c03

13 files changed

+3981
-0
lines changed

Lesson01/Activity01.ipynb

+748
Large diffs are not rendered by default.

Lesson01/Exercise01.ipynb

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Read files from a dataframe"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"\n",
17+
"#Load pandas library\n",
18+
"import pandas as pd \n",
19+
"import seaborn as sns\n"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": 2,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"#URL of the dataset (acknowledgement to Michael Waskom who hosted this data in his github repo)\n",
29+
"diamonds_url = \"https://raw.githubusercontent.com/TrainingByPackt/Interactive-Data-Visualization-with-Python/master/Lesson01/diamonds.csv\"\n"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 3,
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"#Yes, we can read files from a URL straight into a pandas dataframe!\n",
39+
"\n",
40+
"diamonds_df = pd.read_csv(diamonds_url)\n",
41+
"# Since the dataset is available in seaborn, we can alternatively read it in using the following line of code\n",
42+
"\n",
43+
"diamonds_df = sns.load_dataset('diamonds')\n"
44+
]
45+
}
46+
],
47+
"metadata": {
48+
"kernelspec": {
49+
"display_name": "Python 3",
50+
"language": "python",
51+
"name": "python3"
52+
},
53+
"language_info": {
54+
"codemirror_mode": {
55+
"name": "ipython",
56+
"version": 3
57+
},
58+
"file_extension": ".py",
59+
"mimetype": "text/x-python",
60+
"name": "python",
61+
"nbconvert_exporter": "python",
62+
"pygments_lexer": "ipython3",
63+
"version": "3.7.3"
64+
}
65+
},
66+
"nbformat": 4,
67+
"nbformat_minor": 2
68+
}

0 commit comments

Comments
 (0)