给出了下面的熊猫数据图df

如何使用函数获得元组(,max(Close))?
发布于 2020-10-20 19:09:15
可以使用df.idxmax(),如下所示:
print(df.Close.idxmax(), df.Close.max()) # returns a tuple发布于 2020-10-20 19:08:41
这应该适用于你:
date = df['Close'].argmax() # Returns the date with max(Close)
(date, df.loc[date, 'Close']) # The tuple you wanthttps://stackoverflow.com/questions/64451748
复制相似问题