You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just found out a performance issue with pd.Series.map, seems it is very slow when the input is a huge dictionary.
I noticed a similar issue reported before: #21278 and indeed for Series input, the first run might be slow and then for the later runs, they are very fast because hashable indexing is built. However, it doesn't seem to apply to dict input.
I slightly changed the example in #21278, and the runtime doesn't change if being run multiple times. And it is much faster using apply and dict.get.
So I am curious if this performance issue is being aware , and i would expect performance when a dict is assigned between pd.Series.map and pd.Series.apply(lambda x: blabla) is quite similar.
Just found out a performance issue with
pd.Series.map
, seems it is very slow when the input is a huge dictionary.I noticed a similar issue reported before: #21278 and indeed for
Series
input, the first run might be slow and then for the later runs, they are very fast because hashable indexing is built. However, it doesn't seem to apply todict
input.I slightly changed the example in #21278, and the runtime doesn't change if being run multiple times. And it is much faster using
apply
anddict.get
.So I am curious if this performance issue is being aware , and i would expect performance when a dict is assigned between
pd.Series.map
andpd.Series.apply(lambda x: blabla)
is quite similar.while much faster if doing below:
The text was updated successfully, but these errors were encountered: