Skip to content

Commit 6513e20

Browse files
committed
remove references to excel
1 parent 5361388 commit 6513e20

File tree

1 file changed

+30
-60
lines changed

1 file changed

+30
-60
lines changed

index.ipynb

Lines changed: 30 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"cell_type": "markdown",
2121
"metadata": {},
2222
"source": [
23-
"Ok, so now we have gotten a sense of how to take data from excel and move into a list in Python. We also learned about how to work with lists. In this lab we will practice reading from lists, adding elements to lists, and removing elements from lists."
23+
"Ok, so now that we have gotten a sense of how to read from a list and alter a list in Python, let's put this knowledge to practice. "
2424
]
2525
},
2626
{
@@ -43,86 +43,52 @@
4343
"cell_type": "markdown",
4444
"metadata": {},
4545
"source": [
46-
"### Our data from a Google Sheet"
46+
"### Our initial data structure "
4747
]
4848
},
4949
{
5050
"cell_type": "markdown",
5151
"metadata": {},
5252
"source": [
53-
"Once again, we will get our data from a Google Sheet, this time a sheet of [Travel Cities and Countries](https://docs.google.com/spreadsheets/d/1BTJMMFH9t4p5UmHj5kiC6PGfMN6yaaaZkocx0mDqTK0/edit#gid=0). "
53+
"In the previous lesson, we had a list of top travel cities."
5454
]
5555
},
5656
{
57-
"cell_type": "markdown",
58-
"metadata": {},
59-
"source": [
60-
"![](./cities-and-countries.png)"
61-
]
62-
},
63-
{
64-
"cell_type": "markdown",
65-
"metadata": {},
66-
"source": [
67-
"We already followed the steps of the previous lesson to download the spreadsheet and move it to the current folder. You can find the file [in the github repository](https://github.com/learn-co-curriculum/python-lists-lab)."
68-
]
69-
},
70-
{
71-
"cell_type": "markdown",
72-
"metadata": {},
57+
"cell_type": "code",
58+
"execution_count": 2,
59+
"metadata": {
60+
"collapsed": true
61+
},
62+
"outputs": [],
7363
"source": [
74-
"### From Local File to Python "
64+
"top_travel_cities = ['Solta', 'Greenville', 'Buenos Aires', 'Los Cabos', 'Walla Walla Valley', 'Marakesh', 'Albuquerque', 'Archipelago Sea', 'Iguazu Falls', 'Salina Island', 'Toronto', 'Pyeongchang']"
7565
]
7666
},
7767
{
7868
"cell_type": "markdown",
7969
"metadata": {},
8070
"source": [
81-
"Now that we have this file in the folder we are working with, we can get this data into Python code."
71+
"In this lesson we can work with a list of each associated countries for each of those travel cities."
8272
]
8373
},
8474
{
8575
"cell_type": "code",
86-
"execution_count": 3,
76+
"execution_count": 1,
8777
"metadata": {},
8878
"outputs": [],
8979
"source": [
90-
"import pandas\n",
91-
"file_name = './cities_and_countries.xlsx'\n",
92-
"travel_df = pandas.read_excel(file_name)\n",
93-
"travel_data = travel_df.to_dict('records')\n",
94-
"countries = list(map(lambda city: city['Country'] ,travel_data))"
95-
]
96-
},
97-
{
98-
"cell_type": "code",
99-
"execution_count": 4,
100-
"metadata": {},
101-
"outputs": [
102-
{
103-
"data": {
104-
"text/plain": [
105-
"['Croatia',\n",
106-
" 'USA',\n",
107-
" 'Argentina',\n",
108-
" 'Mexico',\n",
109-
" 'USA',\n",
110-
" 'Morocco',\n",
111-
" 'New Mexico',\n",
112-
" 'Finland',\n",
113-
" 'Argentina',\n",
114-
" 'Italy',\n",
115-
" 'Canada',\n",
116-
" 'South Korea']"
117-
]
118-
},
119-
"execution_count": 4,
120-
"metadata": {},
121-
"output_type": "execute_result"
122-
}
123-
],
124-
"source": [
125-
"countries"
80+
"countries = ['Croatia',\n",
81+
" 'USA',\n",
82+
" 'Argentina',\n",
83+
" 'Mexico',\n",
84+
" 'USA',\n",
85+
" 'Morocco',\n",
86+
" 'New Mexico',\n",
87+
" 'Finland',\n",
88+
" 'Argentina',\n",
89+
" 'Italy',\n",
90+
" 'Canada',\n",
91+
" 'South Korea']"
12692
]
12793
},
12894
{
@@ -149,7 +115,9 @@
149115
{
150116
"cell_type": "code",
151117
"execution_count": 10,
152-
"metadata": {},
118+
"metadata": {
119+
"collapsed": true
120+
},
153121
"outputs": [],
154122
"source": [
155123
"italy = countries[-3] # 'Italy'"
@@ -313,7 +281,9 @@
313281
{
314282
"cell_type": "code",
315283
"execution_count": 24,
316-
"metadata": {},
284+
"metadata": {
285+
"collapsed": true
286+
},
317287
"outputs": [],
318288
"source": [
319289
"countries[6] = 'USA'"

0 commit comments

Comments
 (0)