파이썬 SettingWithCopyWarning과 FutureWarning 해결하기: Pandas DataFrame에서 .copy() 사용 및 numeric_only 지정
def create_section_df(df): bins = list(range(0, 401, 10)) bins_label = [str(x) + "이상 " + str(x + 10) + "미만" for x in bins] df["section"] = pd.cut( df["total_worktime"], bins=range(0, 401, 10), right=False, labels=bins_label[:-1] ) df["section_count"] = 1 section_df = df.groupby(["section"], as_index=False)[ [ 'y.m', "total_worktime", ..
2023. 4. 18.