Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yusufuyanik1 opened this issue Sep 29, 2022 · 0 comments

Comments

@yusufuyanik1
Copy link

yusufuyanik1 commented Sep 29, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant