print(food_info["Iron_(mg)"])print(50*"#")
div_1000 = food_info["Iron_(mg)"]/1000print(div_1000)print(50*"#")# Adds 100 to each value in the column and returns a Series object.
#By default, pandas will sort the data by the column we specify in ascending order and return a new DataFrame# Sorts the DataFrame in-place, rather than returning a new DataFrame.print(food_info["Sodium_(mg)"])print(20*"#")
food_info.sort_values("Sodium_(mg)", inplace=True)print(food_info["Sodium_(mg)"])print(20*"#")#Sorts by descending order, rather than ascending.
food_info.sort_values("Sodium_(mg)", inplace=True, ascending=False)print(food_info["Sodium_(mg)"])
0 643.0
1 659.0
2 2.0
3 1146.0
4 560.0
5 629.0
6 842.0
7 690.0
8 644.0
9 700.0
10 604.0
11 364.0
12 344.0
13 372.0
14 308.0
15 406.0
16 365.0
17 812.0
18 917.0
19 800.0
20 600.0
21 819.0
22 714.0
23 800.0
24 600.0
25 627.0
26 710.0
27 619.0
28 682.0
29 628.0
...
8588 2.0
8589 2.0
8590 7.0
8591 564.0
8592 464.0
8593 490.0
8594 1.0
8595 199.0
8596 297.0
8597 16.0
8598 486.0
8599 0.0
8600 2.0
8601 1297.0
8602 1435.0
8603 2838.0
8604 10.0
8605 2.0
8606 12.0
8607 0.0
8608 3326.0
8609 1765.0
8610 3750.0
8611 29.0
8612 58.0
8613 4450.0
8614 667.0
8615 58.0
8616 70.0
8617 68.0
Name: Sodium_(mg), Length: 8618, dtype: float64
####################
760 0.0
758 0.0
405 0.0
761 0.0
2269 0.0
763 0.0
764 0.0
770 0.0
774 0.0
396 0.0
395 0.0
6827 0.0
394 0.0
393 0.0
391 0.0
390 0.0
787 0.0
788 0.0
2270 0.0
2231 0.0
407 0.0
748 0.0
409 0.0
747 0.0
702 0.0
703 0.0
704 0.0
705 0.0
706 0.0
707 0.0
...
8153 NaN
8155 NaN
8156 NaN
8157 NaN
8158 NaN
8159 NaN
8160 NaN
8161 NaN
8163 NaN
8164 NaN
8165 NaN
8167 NaN
8169 NaN
8170 NaN
8172 NaN
8173 NaN
8174 NaN
8175 NaN
8176 NaN
8177 NaN
8178 NaN
8179 NaN
8180 NaN
8181 NaN
8183 NaN
8184 NaN
8185 NaN
8195 NaN
8251 NaN
8267 NaN
Name: Sodium_(mg), Length: 8618, dtype: float64
####################
276 38758.0
5814 27360.0
6192 26050.0
1242 26000.0
1245 24000.0
1243 24000.0
1244 23875.0
292 17000.0
1254 11588.0
5811 10600.0
8575 9690.0
291 8068.0
1249 8031.0
5812 7893.0
1292 7851.0
293 7203.0
4472 7027.0
4836 6820.0
1261 6580.0
3747 6008.0
1266 5730.0
4835 5586.0
4834 5493.0
1263 5356.0
1553 5203.0
1552 5053.0
1251 4957.0
1257 4843.0
294 4616.0
8613 4450.0
...
8153 NaN
8155 NaN
8156 NaN
8157 NaN
8158 NaN
8159 NaN
8160 NaN
8161 NaN
8163 NaN
8164 NaN
8165 NaN
8167 NaN
8169 NaN
8170 NaN
8172 NaN
8173 NaN
8174 NaN
8175 NaN
8176 NaN
8177 NaN
8178 NaN
8179 NaN
8180 NaN
8181 NaN
8183 NaN
8184 NaN
8185 NaN
8195 NaN
8251 NaN
8267 NaN
Name: Sodium_(mg), Length: 8618, dtype: float64