我的密码tried:I can 能够根据第一次输入进行分组,但需要过滤方面的帮助
需要对Jobgrade=2和Age=23的组进行分组
import pandas as pd
df=pd.read_csv(r'C:\Users\Nishank\Desktop\tests.csv')
input_list = [['Jobgrade','Age'],[2,23]]
cols=input_list[0]
rows=input_list[1]
dy = df.groupby(cols).first()
print(dy)
输入数据帧:
预期输出:
目前没有回答
相关问题 更多 >
编程相关推荐