0

I want to filter max value from 7th column and respective row (date and time)

from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#pd.set_option('display.max_columns', None)
a = pd.read_html("D:\\abcd\New folder\PRTG Report AIRTEL-5PM to 9 PM 64-32768-32723.html", flavor='bs4',header=None)
df0=a[0]
df1=a[1]
df2=a[2][https://i.stack.imgur.com/ZkbjT.png][1]
df3=a[3]
df=df0.append([df1,df2,df3])
df[df != 'Average'].iloc[:,[1,7]].dropna()

Open image

Izaak van Dongen
  • 2,450
  • 13
  • 23

1 Answers1

1

First obtain the index for maximum value in column 7 by using idxmax and then use that index to get the row:

index_for_max_7 = df.iloc[:,7].idxmax()
df.iloc[index_for_max_7]
nucsit026
  • 652
  • 7
  • 16
Krzysztof Słowiński
  • 6,239
  • 8
  • 44
  • 62