new_df = pd.concat(new_dataset)
print(new_df.shape)
new_df = new_df.dropna(how='any')
print(new_df.shape)
new_df.head(20)

现在,我想添加另一个列,根据'Close_gap_IUD‘列中的值命名'Close_gap’。我要:
的零值(==0)
我该怎么做?
发布于 2022-05-01 01:49:14
new_df["Close_gap_IUD"] = new_df["Close_gap"].apply(lambda x: "Increase" if x > 0 else "Decrease" if x < 0 else "Unchanged")https://stackoverflow.com/questions/72071185
复制相似问题