Skip to content

Commit

Permalink
fix fictional armies
Browse files Browse the repository at this point in the history
  • Loading branch information
guipsamora committed Aug 18, 2018
1 parent caa25f0 commit b455113
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 88 deletions.
83 changes: 44 additions & 39 deletions 02_Filtering_&_Sorting/Fictional Army/Exercise_with_solutions.ipynb
Expand Up @@ -40,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {
"collapsed": true
},
Expand Down Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 3,
"metadata": {
"collapsed": false
},
Expand All @@ -88,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 4,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -305,7 +305,7 @@
"Georgia 1 3 "
]
},
"execution_count": 20,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -324,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 5,
"metadata": {
"collapsed": false
},
Expand All @@ -348,7 +348,7 @@
"Name: veterans, dtype: int64"
]
},
"execution_count": 12,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -366,7 +366,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 6,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -470,7 +470,7 @@
"Georgia 345 35"
]
},
"execution_count": 13,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -488,7 +488,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand All @@ -501,7 +501,7 @@
" dtype='object')"
]
},
"execution_count": 16,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -519,7 +519,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 8,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -567,7 +567,7 @@
"Alaska 523 987 24"
]
},
"execution_count": 24,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -586,7 +586,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 9,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -648,7 +648,7 @@
"Alaska 8 987 949"
]
},
"execution_count": 26,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -667,7 +667,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 10,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -842,7 +842,7 @@
"Georgia 1 3 "
]
},
"execution_count": 28,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -860,7 +860,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 11,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -951,7 +951,7 @@
"Texas 1 31 "
]
},
"execution_count": 30,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -969,7 +969,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 12,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -1087,7 +1087,7 @@
"Georgia 1523 345 3"
]
},
"execution_count": 32,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1108,7 +1108,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 13,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -1269,7 +1269,7 @@
"Wyoming 0 3 "
]
},
"execution_count": 33,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1287,7 +1287,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 14,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -1434,7 +1434,7 @@
"Georgia 1 3 "
]
},
"execution_count": 35,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1452,7 +1452,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 15,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -1613,7 +1613,7 @@
"Georgia 1 3 "
]
},
"execution_count": 37,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1631,7 +1631,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 16,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -1708,13 +1708,13 @@
"Texas 1 31 "
]
},
"execution_count": 38,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"army.loc[['Arizona', 'Texas'], :]"
"army.loc[['Arizona', 'Texas']]"
]
},
{
Expand All @@ -1726,18 +1726,20 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"523"
"origin\n",
"Arizona 523\n",
"Name: deaths, dtype: int64"
]
},
"execution_count": 41,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1747,7 +1749,7 @@
"\n",
"#OR\n",
"\n",
"army.loc[['Arizona'], [army.columns[2]]]"
"army.iloc[[0], army.columns.get_loc('deaths')]"
]
},
{
Expand All @@ -1759,18 +1761,20 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"25"
"origin\n",
"Texas 25\n",
"Name: deaths, dtype: int64"
]
},
"execution_count": 43,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1780,13 +1784,14 @@
"\n",
"#OR\n",
"\n",
"army.iloc[2, army.columns.get_loc('deaths')]\n"
"army.iloc[[2], army.columns.get_loc('deaths')]\n"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python [default]",
"language": "python",
"name": "python2"
},
Expand All @@ -1800,7 +1805,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"version": "2.7.12"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b455113

Please sign in to comment.