|
19 | 19 | }, |
20 | 20 | { |
21 | 21 | "cell_type": "code", |
22 | | - "execution_count": 3, |
| 22 | + "execution_count": 1, |
23 | 23 | "metadata": { |
24 | 24 | "collapsed": false |
25 | 25 | }, |
|
44 | 44 | }, |
45 | 45 | { |
46 | 46 | "cell_type": "code", |
47 | | - "execution_count": 4, |
| 47 | + "execution_count": 3, |
48 | 48 | "metadata": { |
49 | 49 | "collapsed": false |
50 | 50 | }, |
|
64 | 64 | }, |
65 | 65 | { |
66 | 66 | "cell_type": "code", |
67 | | - "execution_count": 168, |
| 67 | + "execution_count": 4, |
68 | 68 | "metadata": { |
69 | 69 | "collapsed": false |
70 | 70 | }, |
|
75 | 75 | "1130" |
76 | 76 | ] |
77 | 77 | }, |
78 | | - "execution_count": 168, |
| 78 | + "execution_count": 4, |
79 | 79 | "metadata": {}, |
80 | 80 | "output_type": "execute_result" |
81 | 81 | } |
|
104 | 104 | }, |
105 | 105 | { |
106 | 106 | "cell_type": "code", |
107 | | - "execution_count": 176, |
| 107 | + "execution_count": 9, |
108 | 108 | "metadata": { |
109 | 109 | "collapsed": false |
110 | 110 | }, |
|
430 | 430 | "34 Bottled Water 1.09" |
431 | 431 | ] |
432 | 432 | }, |
433 | | - "execution_count": 176, |
| 433 | + "execution_count": 9, |
434 | 434 | "metadata": {}, |
435 | 435 | "output_type": "execute_result" |
436 | 436 | } |
|
439 | 439 | "# delete the duplicates in item_name and quantity\n", |
440 | 440 | "chipo_filtered = chipo.drop_duplicates(['item_name','quantity'])\n", |
441 | 441 | "\n", |
442 | | - "# select only the ones with quantity equals to 1\n", |
443 | | - "price_per_item = chipo_filtered[chipo_filtered.quantity == 1]\n", |
| 442 | + "# select only the products with quantity equals to 1\n", |
| 443 | + "chipo_one_prod = chipo_filtered[chipo_filtered.quantity == 1]\n", |
444 | 444 | "\n", |
445 | | - "#\n", |
446 | | - "price_per_item = chipo_end[['item_name', 'item_price']]\n", |
| 445 | + "# select only the item_name and item_price columns\n", |
| 446 | + "price_per_item = chipo_one_prod[['item_name', 'item_price']]\n", |
447 | 447 | "\n", |
448 | 448 | "# sort the values from the most to less expensive\n", |
449 | 449 | "price_per_item.sort_values(by = \"item_price\", ascending = False)" |
|
665 | 665 | } |
666 | 666 | ], |
667 | 667 | "metadata": { |
| 668 | + "anaconda-cloud": {}, |
668 | 669 | "kernelspec": { |
669 | | - "display_name": "Python 2", |
| 670 | + "display_name": "Python [default]", |
670 | 671 | "language": "python", |
671 | 672 | "name": "python2" |
672 | 673 | }, |
|
680 | 681 | "name": "python", |
681 | 682 | "nbconvert_exporter": "python", |
682 | 683 | "pygments_lexer": "ipython2", |
683 | | - "version": "2.7.11" |
| 684 | + "version": "2.7.12" |
684 | 685 | } |
685 | 686 | }, |
686 | 687 | "nbformat": 4, |
|
0 commit comments