I have a pandas dataframe that has duplicate data. Similar to below table. I want to drop duplicates keeping only the rows with value close to zero in column2
table1
Cloumn1 column2
1100 -27
1100 0
1100 10
1300 -2
1300 12
Resultant table looks like
Cloumn1 column2
1100 0
1300 -2
Hope someone can help on this
table1
Cloumn1 column2
1100 -27
1100 0
1100 10
1300 -2
1300 12
Resultant table looks like
Cloumn1 column2
1100 0
1300 -2
Hope someone can help on this
import pandas as pd table = pd.DataFrame(data = {'Col1':[1100,1100,1100,1300,1300], 'Col2':[-27,0,10,-2,12]})