Remove the pd.DataFrame
and pd.Series
extension methods
#368
Labels
Milestone
pd.DataFrame
and pd.Series
extension methods
#368
Currently, if pandas is installed,
import lmo
automatically registers the dataframe- and series accessors (pandas docs). There are several major issues with this approach:import lmo
ifpandas
is installed, even if the user doesn't importpandas
. If I remember correctly from a benchmark I did a while back, this is responsible for the majority of the runtime of an (initial)import lmo
call.pd.DataFrame
andpd.Series
actually have thel_*
methods, let alone their exact signatures. The only workaround is to manuallycast
the dataframe or series instances tolmo.contrib.pandas.{DataFrame,Pandas}
, which is very annoying.Series.l_{}(...)
just callslmo.l_{}(_, ...)
on the instance, and in the "plural" cases, rewraps it as aSeries
with a new"r"
index. Once Support__array_ufunc__
inlmo.l_(loc|scale|variation|skew|kurtosis)
#184 is implemented, this could (for the most part) also be done with a simplelmo.l_{}
, which is a better alternative.DataFrame.l_{}(...)
is basically an alias forDataFrame.apply(lmo.l_{}, ...)
, so almost as easy to do it manually.The text was updated successfully, but these errors were encountered: