-1

I want to extract the highest price but I dont know how here is my code:

import pandas
import pandas_datareader.data as pdr
import datetime as dt

start = dt.datetime(2021,1,29)
end = dt.datetime(2021,2,18)
df = pdr.DataReader('BTC-USD','yahoo',start,end)

it returns cloumns and i want to print just the highest price

Cnous
  • 41
  • 5
  • Does this answer your question? [Find maximum value of a column and return the corresponding row values using Pandas](https://stackoverflow.com/questions/15741759/find-maximum-value-of-a-column-and-return-the-corresponding-row-values-using-pan) – Henry Ecker Jul 22 '21 at 14:24
  • [How to find maximum value of a column in python dataframe](https://stackoverflow.com/q/43924686/15497888) – Henry Ecker Jul 22 '21 at 14:25

2 Answers2

2

If you're interested in the maximal values of the High column, you can calculate it like:

df['High'].max()
saaj
  • 23,253
  • 3
  • 104
  • 105
0

Try with idxmax

maxrow = df.loc[df['col'].idxmax()]
BENY
  • 317,841
  • 20
  • 164
  • 234