df_play = pd.read_csv("players_stats_by_season_full_details.csv")
VC = df_play[df_play["League"] == "NBA"]
VC
VC["FT_Miss"] = VC['FTA'] - VC['FTM']
错误消息:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
答案 0 :(得分:1)
VC
不是数据帧,它是原始数据的一部分,意味着它只是指向df_play的指针
尝试;
VC = df_play[df_play["League"] == "NBA"].copy()