我想计算数据框中有多少示例具有相同的条件。在计算示例之前,我将选择标准。
我想将它与 groupby 一起使用,但我没有找到解决方案
df_education = df.groupby(['Education','Self_Employed',"Loan_Status"], axis=0).count()
最佳答案
你尝试过吗:
df_education = df.groupby(
["Education", "Self_Employed", "Loan_Status"],
axis=0
).size()
关于python 基于标准的计数示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58751186/