pandas_exercises icon indicating copy to clipboard operation
pandas_exercises copied to clipboard

Faster Alternative to 01_Getting_&_Knowing_Your_Data - World Food Facts Step 11

Open yusufuyanik1 opened this issue 3 years ago • 0 comments

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: Screen Shot 2022-09-29 at 16 54 06

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?

yusufuyanik1 avatar Sep 29 '22 14:09 yusufuyanik1