5

pandas 如何将分组的 value 传入 apply 函数中

 2 years ago
source link: https://www.v2ex.com/t/778377
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Python

pandas 如何将分组的 value 传入 apply 函数中

  ErenJaeger · 3 小时 22 分钟前 · 105 次点击
In [4]: df
Out[4]:
   name  age cup
0   hah   18   A
1  wuwu   19   B
2  bibi   20   C
3  diid   21   D

def hh(df, cup_value):
	...
	return 

我想按 cup,分组如何将 cup 的值传入 apply 函数中?除去在 apply 函数中根据 df 获取


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK