Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 18848

Apply expanding function over whole df - numba and alternatives?

$
0
0

I want to apply an expanding window operation on the whole df - not columnwise.The method=table requires numba engine. But I always get an error when calling it (see below)

I would also appreciate it, if anyone could point out another solution to my problem (i.e. I don't necessarily want to use numba).

S = pd.Series([i / 100.0 for i in range(1, 11)])d_from = pd.concat([S, S], axis=1)# In a df expanding operates column or rowwised_from.expanding(axis=0).apply(sum, raw=True)d_from.expanding(axis=1).apply(sum, raw=True)# can use table arg and numba to operate on whole df?d_from.expanding(axis=1, method="table").apply(sum, raw=True, engine="numba")  # throws exception

The last line produces : "numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)"


Viewing all articles
Browse latest Browse all 18848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>