1 ~符号
>>> pd.Index([0])
Index([0], dtype='int64')
>>> ~pd.Index([0])
Index([-1], dtype='int64')
2 不好使用~符号
wm.loc[index, '是否超期1年'] = True wm['是否超期1年'] = wm['是否超期1年'].map(lambda x: x if x is True else False)
3 df.index & df.columns
4 ser.name& ser.index
5 ser 看起来是 df.row 的转置
df.row => ser # 实际不存在这个属性 用apply(axis=1)获取row
ser.name=> df.row.index
ser.index =>df.columns