ENH: option to force slow code path (don't call apply function 1 too many times) in GroupBy.apply
See original GitHub issue>>> def applym(df):
... print df.irow(0)['a']
... return DataFrame({'a':[1],'b':[1]})
>>> df = DataFrame({'a':[1,1,1,2,3],'b':['a','a','a','b','c']})
>>> df.groupby('b').apply(applym)
1
1
2
3
a b
b
a 0 1 1
b 0 1 1
c 0 1 1
>>>
applym is called twice on the first group.
Issue Analytics
- State:
- Created 11 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Pandas dataframe groupby + apply + new column is slow
In the current implementation apply calls func twice on the first group to decide whether it can take a fast or slow code...
Read more >Slow in the Application, Fast in SSMS? - Erland Sommarskog
In this chapter we will look at how SQL Server compiles a stored procedure and uses the plan cache. If your application does...
Read more >Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >Why pandas apply method is slow, and how Terality ...
This article will focus on the method apply with axis=1, which evaluates a function on every row. The axis=0 version evaluates a function...
Read more >KEPServerEX Manual - Kepware
Auto generation produced too many overwrites, stopped posting error messages. ... Account '<name>' does not have permission to run this application.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also using groupby.apply() on little number of groups, that sometimes can be just 1 depending on User inputs. In that particular case the code is 2x slower.
An option to force the path would be quite appreciated.
Marked as enhancement for someday. Just have to get a groupby parameter to flow through