pandas_exercises
pandas_exercises copied to clipboard
Faster Alternative to 01_Getting_&_Knowing_Your_Data - World Food Facts Step 11
My propesed solution for step 11 is:
food.iloc[:, 7][18]
instead of:
food.values[18][7]
Picking an index from a Series works much faster than picking it from an numpy.ndarray
We can first pick the product_name column as a series and then find the product at the requested index.
You can find the processing time difference on my system below:

Note: I wanted to create a PR instead of an issue but when I checked the differences on such a small PR, I see a lot of differences in json format, which is difficult to read. Does anyone know if we should post PR's like that on an .ipynb file or is there a cleaner way to do so?