import pandas as pd
data = pd.read_csv('data1.csv',encoding='GBK')
null_all = data.isnull().sum()
fill_data = data.fillna('-999')
null_all = fill_data.isnull().sum()
print(null_all)
print(fill_data.iloc[:3])
df=pd.read_csv('data1.csv', usecols=['cust_id', 'max_ovd_days'])
df.to_excel('fil.xlsx')
print(fill_data['max_ovd_days'])
for i in fill_data['max_ovd_days']:
if i > 30:
y = 1
elif i == 0:
y = 0
else:
y = '不错'
print(y)
fill_data['好坏']=y
print(fill_data)
请问想在后面添加一列,为什么 这个‘好坏‘的一列只有不错这个值