我确实有一个包含som计算值的数据框,并且我试图在代码的最后一行中找到此列3中每个rov的最大值,但始终选择“ IH-CP I”,我在做什么错了?
def atr_calculation(df, ma):
df['H-L'] = df['High']-df['Low']
df['IH-CP I'] = abs(df['High']-df['Adj Close'])
df['IL-CP I'] = abs(df['Low']-df['Adj Close'])
df['ATR'] = df[['H-L', 'IH-CP I', 'IL-CP I']].max(axis=1)