题解 | #修补缺失的用户数据#
修补缺失的用户数据
https://www.nowcoder.com/practice/9863e81c8eba4c33817b26b801a17313
import pandas as pd
data = pd.read_csv("Nowcoder.csv", sep=",")
pd.set_option("display.max_columns", None)pd.set_option("display.max_rows", None)
pd.set_option("display.width", 300)
if data["Language"] is None:data["Language"] == "Python"
fillmax = data["Graduate_year"].max()
if data["Graduate_year"] is None:data["Graduate_year"] = fillmax
avg = int(data["Achievement_value"].mean().round())
if data["Achievement_value"] is None:data["Achievement_value"] = avg
print(data)