|
6 | 6 | "collapsed": false
|
7 | 7 | },
|
8 | 8 | "source": [
|
| 9 | + "\n", |
9 | 10 | "#🐼 Sandbox for pandas\n",
|
10 | 11 | "\n",
|
11 |
| - "Play with the pandas data analysis library for Python.\n", |
| 12 | + "Play with the pandas data analysis library for Python. \n", |
12 | 13 | "\n",
|
13 | 14 | "[Setup](#setup)\n",
|
14 | 15 | "\n",
|
|
35 | 36 | "source": [
|
36 | 37 | "###Setup<a id=\"setup\"></a>\n",
|
37 | 38 | "\n",
|
38 |
| - "If you have [Anaconda](https://www.continuum.io/downloads) installed, it includes all the packages you'll need to import. \n", |
| 39 | + "If you have [Anaconda](https://www.continuum.io/downloads) installed, it includes [Jupyter (IPython) notebook](http://jupyter.org/) and all the packages you'll need to import. \n", |
39 | 40 | "\n",
|
40 | 41 | "If you aren't using Anaconda, download and install the following packages via pip with `pip install [packagename]` \n",
|
41 | 42 | "\n",
|
42 | 43 | "- [pandas](http://pandas.pydata.org): a data analysis library.\n",
|
43 | 44 | "- [numpy](http://www.numpy.org/): pandas is built on top of numpy, a Python extension for working with arrays and math.\n",
|
44 |
| - "- [matplotlib](http://matplotlib.org/): a plotting library that plays well with pandas DataFrames and numpy arrays." |
| 45 | + "- [matplotlib](http://matplotlib.org/): a plotting library that plays well with pandas DataFrames and numpy arrays.\n", |
| 46 | + "\n", |
| 47 | + "*Please note: This is a Python 2.7 notebook. If your Jupyter notebook is running on Python 3, avoid errors by [setting up a Python 2 kernel](https://ipython.readthedocs.org/en/latest/install/kernel_install.html).*" |
45 | 48 | ]
|
46 | 49 | },
|
47 | 50 | {
|
48 | 51 | "cell_type": "code",
|
49 |
| - "execution_count": 165, |
| 52 | + "execution_count": 1, |
50 | 53 | "metadata": {
|
51 | 54 | "collapsed": true
|
52 | 55 | },
|
|
78 | 81 | },
|
79 | 82 | {
|
80 | 83 | "cell_type": "code",
|
81 |
| - "execution_count": 71, |
| 84 | + "execution_count": 2, |
82 | 85 | "metadata": {
|
83 | 86 | "collapsed": true
|
84 | 87 | },
|
|
110 | 113 | },
|
111 | 114 | {
|
112 | 115 | "cell_type": "code",
|
113 |
| - "execution_count": 72, |
| 116 | + "execution_count": 3, |
114 | 117 | "metadata": {
|
115 | 118 | "collapsed": false
|
116 | 119 | },
|
|
228 | 231 | "4 1 1 0 0 0 1 3 "
|
229 | 232 | ]
|
230 | 233 | },
|
231 |
| - "execution_count": 72, |
| 234 | + "execution_count": 3, |
232 | 235 | "metadata": {},
|
233 | 236 | "output_type": "execute_result"
|
234 | 237 | }
|
|
250 | 253 | },
|
251 | 254 | {
|
252 | 255 | "cell_type": "code",
|
253 |
| - "execution_count": 73, |
| 256 | + "execution_count": 4, |
254 | 257 | "metadata": {
|
255 | 258 | "collapsed": false
|
256 | 259 | },
|
|
375 | 378 | "10740 1 0 1 1 1 5 "
|
376 | 379 | ]
|
377 | 380 | },
|
378 |
| - "execution_count": 73, |
| 381 | + "execution_count": 4, |
379 | 382 | "metadata": {},
|
380 | 383 | "output_type": "execute_result"
|
381 | 384 | }
|
|
394 | 397 | },
|
395 | 398 | {
|
396 | 399 | "cell_type": "code",
|
397 |
| - "execution_count": 74, |
| 400 | + "execution_count": 5, |
398 | 401 | "metadata": {
|
399 | 402 | "collapsed": false
|
400 | 403 | },
|
|
485 | 488 | "3715 1 0 1 1 1 5 "
|
486 | 489 | ]
|
487 | 490 | },
|
488 |
| - "execution_count": 74, |
| 491 | + "execution_count": 5, |
489 | 492 | "metadata": {},
|
490 | 493 | "output_type": "execute_result"
|
491 | 494 | }
|
|
504 | 507 | },
|
505 | 508 | {
|
506 | 509 | "cell_type": "code",
|
507 |
| - "execution_count": 111, |
| 510 | + "execution_count": 6, |
508 | 511 | "metadata": {
|
509 | 512 | "collapsed": false,
|
510 |
| - "scrolled": true |
| 513 | + "scrolled": false |
511 | 514 | },
|
512 | 515 | "outputs": [
|
513 | 516 | {
|
|
1585 | 1588 | "[10741 rows x 10 columns]"
|
1586 | 1589 | ]
|
1587 | 1590 | },
|
1588 |
| - "execution_count": 111, |
| 1591 | + "execution_count": 6, |
1589 | 1592 | "metadata": {},
|
1590 | 1593 | "output_type": "execute_result"
|
1591 | 1594 | }
|
|
1616 | 1619 | },
|
1617 | 1620 | {
|
1618 | 1621 | "cell_type": "code",
|
1619 |
| - "execution_count": 160, |
| 1622 | + "execution_count": 7, |
1620 | 1623 | "metadata": {
|
1621 | 1624 | "collapsed": false
|
1622 | 1625 | },
|
|
1645 | 1648 | ],
|
1646 | 1649 | "source": [
|
1647 | 1650 | "# get summary information about your DataFrame\n",
|
1648 |
| - "df.info()" |
| 1651 | + "df.info()\n", |
| 1652 | + "select = df" |
1649 | 1653 | ]
|
1650 | 1654 | },
|
1651 | 1655 | {
|
|
1657 | 1661 | },
|
1658 | 1662 | {
|
1659 | 1663 | "cell_type": "code",
|
1660 |
| - "execution_count": 161, |
| 1664 | + "execution_count": 8, |
1661 | 1665 | "metadata": {
|
1662 | 1666 | "collapsed": false
|
1663 | 1667 | },
|
|
1786 | 1790 | "max 1.000000 6.000000 "
|
1787 | 1791 | ]
|
1788 | 1792 | },
|
1789 |
| - "execution_count": 161, |
| 1793 | + "execution_count": 8, |
1790 | 1794 | "metadata": {},
|
1791 | 1795 | "output_type": "execute_result"
|
1792 | 1796 | }
|
|
1811 | 1815 | },
|
1812 | 1816 | {
|
1813 | 1817 | "cell_type": "code",
|
1814 |
| - "execution_count": 162, |
| 1818 | + "execution_count": 9, |
1815 | 1819 | "metadata": {
|
1816 | 1820 | "collapsed": false,
|
1817 | 1821 | "scrolled": true
|
|
2022 | 2026 | "The Miriam and Ira D. Wallach Division of Art, Prints and Photographs: Print Collection 4.110000 "
|
2023 | 2027 | ]
|
2024 | 2028 | },
|
2025 |
| - "execution_count": 162, |
| 2029 | + "execution_count": 9, |
2026 | 2030 | "metadata": {},
|
2027 | 2031 | "output_type": "execute_result"
|
2028 | 2032 | }
|
|
2042 | 2046 | },
|
2043 | 2047 | {
|
2044 | 2048 | "cell_type": "code",
|
2045 |
| - "execution_count": 163, |
| 2049 | + "execution_count": 10, |
2046 | 2050 | "metadata": {
|
2047 | 2051 | "collapsed": false
|
2048 | 2052 | },
|
|
2160 | 2164 | "178 1 1 1 1 6 "
|
2161 | 2165 | ]
|
2162 | 2166 | },
|
2163 |
| - "execution_count": 163, |
| 2167 | + "execution_count": 10, |
2164 | 2168 | "metadata": {},
|
2165 | 2169 | "output_type": "execute_result"
|
2166 | 2170 | }
|
|
2179 | 2183 | },
|
2180 | 2184 | {
|
2181 | 2185 | "cell_type": "code",
|
2182 |
| - "execution_count": 164, |
| 2186 | + "execution_count": 11, |
2183 | 2187 | "metadata": {
|
2184 | 2188 | "collapsed": false
|
2185 | 2189 | },
|
|
2192 | 2196 | "dtype: int64"
|
2193 | 2197 | ]
|
2194 | 2198 | },
|
2195 |
| - "execution_count": 164, |
| 2199 | + "execution_count": 11, |
2196 | 2200 | "metadata": {},
|
2197 | 2201 | "output_type": "execute_result"
|
2198 | 2202 | }
|
|
2215 | 2219 | },
|
2216 | 2220 | {
|
2217 | 2221 | "cell_type": "code",
|
2218 |
| - "execution_count": 84, |
| 2222 | + "execution_count": 12, |
2219 | 2223 | "metadata": {
|
2220 | 2224 | "collapsed": false
|
2221 | 2225 | },
|
|
2245 | 2249 | },
|
2246 | 2250 | {
|
2247 | 2251 | "cell_type": "code",
|
2248 |
| - "execution_count": 105, |
| 2252 | + "execution_count": 13, |
2249 | 2253 | "metadata": {
|
2250 | 2254 | "collapsed": false
|
2251 | 2255 | },
|
|
2277 | 2281 | },
|
2278 | 2282 | {
|
2279 | 2283 | "cell_type": "code",
|
2280 |
| - "execution_count": 139, |
| 2284 | + "execution_count": 14, |
2281 | 2285 | "metadata": {
|
2282 | 2286 | "collapsed": false
|
2283 | 2287 | },
|
2284 | 2288 | "outputs": [
|
| 2289 | + { |
| 2290 | + "name": "stderr", |
| 2291 | + "output_type": "stream", |
| 2292 | + "text": [ |
| 2293 | + "C:\\Anaconda\\lib\\site-packages\\pandas\\core\\frame.py:1808: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n", |
| 2294 | + " \"DataFrame index.\", UserWarning)\n" |
| 2295 | + ] |
| 2296 | + }, |
2285 | 2297 | {
|
2286 | 2298 | "data": {
|
2287 | 2299 | "text/html": [
|
|
2333 | 2345 | "20 86890560-c52c-012f-dbeb-58d385a7bc34 Cigarette cards"
|
2334 | 2346 | ]
|
2335 | 2347 | },
|
2336 |
| - "execution_count": 139, |
| 2348 | + "execution_count": 14, |
2337 | 2349 | "metadata": {},
|
2338 | 2350 | "output_type": "execute_result"
|
2339 | 2351 | }
|
|
2358 | 2370 | },
|
2359 | 2371 | {
|
2360 | 2372 | "cell_type": "code",
|
2361 |
| - "execution_count": 140, |
| 2373 | + "execution_count": 15, |
2362 | 2374 | "metadata": {
|
2363 | 2375 | "collapsed": false,
|
2364 | 2376 | "scrolled": true
|
|
2575 | 2587 | "The Miriam and Ira D. Wallach Division of Art, Prints and Photographs: Print Collection 124 "
|
2576 | 2588 | ]
|
2577 | 2589 | },
|
2578 |
| - "execution_count": 140, |
| 2590 | + "execution_count": 15, |
2579 | 2591 | "metadata": {},
|
2580 | 2592 | "output_type": "execute_result"
|
2581 | 2593 | }
|
|
2603 | 2615 | },
|
2604 | 2616 | {
|
2605 | 2617 | "cell_type": "code",
|
2606 |
| - "execution_count": 159, |
| 2618 | + "execution_count": 16, |
2607 | 2619 | "metadata": {
|
2608 | 2620 | "collapsed": false
|
2609 | 2621 | },
|
|
3074 | 3086 | "[161 rows x 2 columns]"
|
3075 | 3087 | ]
|
3076 | 3088 | },
|
3077 |
| - "execution_count": 159, |
| 3089 | + "execution_count": 16, |
3078 | 3090 | "metadata": {},
|
3079 | 3091 | "output_type": "execute_result"
|
3080 | 3092 | }
|
|
3095 | 3107 | },
|
3096 | 3108 | {
|
3097 | 3109 | "cell_type": "code",
|
3098 |
| - "execution_count": null, |
| 3110 | + "execution_count": 17, |
3099 | 3111 | "metadata": {
|
3100 |
| - "collapsed": true |
| 3112 | + "collapsed": false |
3101 | 3113 | },
|
3102 | 3114 | "outputs": [],
|
3103 | 3115 | "source": [
|
3104 | 3116 | "# export your data as a csv file\n",
|
3105 |
| - "ids_by_collection.to_csv('ids_by_coll.csv')" |
| 3117 | + "ids_by_coll.to_csv('ids_by_coll.csv')" |
3106 | 3118 | ]
|
3107 | 3119 | },
|
3108 | 3120 | {
|
|
3123 | 3135 | },
|
3124 | 3136 | {
|
3125 | 3137 | "cell_type": "code",
|
3126 |
| - "execution_count": 153, |
| 3138 | + "execution_count": 18, |
3127 | 3139 | "metadata": {
|
3128 | 3140 | "collapsed": false
|
3129 | 3141 | },
|
3130 | 3142 | "outputs": [
|
3131 | 3143 | {
|
3132 | 3144 | "data": {
|
3133 | 3145 | "text/plain": [
|
3134 |
| - "<matplotlib.axes._subplots.AxesSubplot at 0x109caa90>" |
| 3146 | + "<matplotlib.axes._subplots.AxesSubplot at 0xcbda0b8>" |
3135 | 3147 | ]
|
3136 | 3148 | },
|
3137 |
| - "execution_count": 153, |
| 3149 | + "execution_count": 18, |
3138 | 3150 | "metadata": {},
|
3139 | 3151 | "output_type": "execute_result"
|
3140 | 3152 | },
|
|
3286 | 3298 | "SFBUSiISFJWSiARFpSQiQfl/w/6i69yPxGIAAAAASUVORK5CYII=\n"
|
3287 | 3299 | ],
|
3288 | 3300 | "text/plain": [
|
3289 |
| - "<matplotlib.figure.Figure at 0xfc5e400>" |
| 3301 | + "<matplotlib.figure.Figure at 0xc790da0>" |
3290 | 3302 | ]
|
3291 | 3303 | },
|
3292 | 3304 | "metadata": {},
|
|
0 commit comments