Skip to content

Commit a0be802

Browse files
authored
Merge pull request #2 from samson-bakos/master
Added work around for data access
2 parents bcfdad7 + e773ea6 commit a0be802

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Exercises for Data Visualization
2-
This repo contains exercises for data visualization module of Data Bootcamp.
2+
This repo contains exercises for the data visualization module of the LHL Data Bootcamp.

matplotlib_exercise.ipynb

+9-8
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@
3636
},
3737
"outputs": [],
3838
"source": [
39-
"df=pd.read_csv('https://pynative.com/wp-content/uploads/2019/01/company_sales_data.csv')"
39+
"# This datasource doesn't allow us to access it directly \n",
40+
"# We need to modify read_csv's user agent \n",
41+
"# Basically, we're accessing as if through a Firefox Browser\n",
42+
"\n",
43+
"url = 'https://pynative.com/wp-content/uploads/2019/01/company_sales_data.csv'\n",
44+
"storage_options = {'User-Agent': 'Mozilla/5.0'}\n",
45+
"df = pd.read_csv(url, storage_options=storage_options)"
4046
]
4147
},
4248
{
4349
"cell_type": "code",
4450
"execution_count": null,
45-
"metadata": {
46-
"ExecuteTime": {
47-
"end_time": "2020-04-23T18:18:27.606163Z",
48-
"start_time": "2020-04-23T18:18:27.594265Z"
49-
}
50-
},
51+
"metadata": {},
5152
"outputs": [],
5253
"source": [
5354
"df.head()"
@@ -151,7 +152,7 @@
151152
"name": "python",
152153
"nbconvert_exporter": "python",
153154
"pygments_lexer": "ipython3",
154-
"version": "3.7.9"
155+
"version": "3.10.6"
155156
},
156157
"toc": {
157158
"base_numbering": 1,

0 commit comments

Comments
 (0)