Equivalent of groupby apply in python pandas

Reply
New Contributor
Posts: 3

Equivalent of groupby apply in python pandas

Hello All,

 

I just started using SAS, coming from Python Pandas. I would like to know what is the equivalent of groupby().apply() or groupby().fillna()

 

For a large dataset, I would need to group observations by certain columns, and fill the missing observations according to the value in each group. This is pretty straight forward in Pandas, but im struggling to get started with the right way in SAS. 

 

Thank you,

 

 

Respected Advisor
Posts: 4,816

Re: Equivalent of groupby apply in python pandas

I can think of three ways to do this kind of processing

 

  • Compute group summaries with proc summary or proc univariate and then merge back into the data with a datastep merge.
  • Do both operations at once with SQL
  • Do both operations in a datastep with two DO UNTIL loops
PG
Super User
Posts: 9,867

Re: Equivalent of groupby apply in python pandas

Can you plz post an example to explain what you want ?
Especially for us don't know Python much . 

Ask a Question
Discussion stats
  • 2 replies
  • 376 views
  • 0 likes
  • 3 in conversation