best practise apply pint function on pandas dataframe #2031
Unanswered
SchabiDesigns
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think using apply will always be slower as it is applied row by row. Can your function operate on an array?
May just work |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
I am quite sure I am not the first who noticed the bad performance when applying a pint function on a large dataframe. :)
So when I have an column with values and want to convert them to another unit with a given function that takes forever.
I am aware of the workaround with pint-pandas to add the needed values first as separate columns to the dataframe and then calculate the desired result column, but I would like to prevent to code another method to adress data input from dataframes. How do you address that issue?
the function itself is not a big deal...
Thanks for your input in advance! 👍
Regards Schabi
Beta Was this translation helpful? Give feedback.
All reactions