With the following code I get:
import pandas as pd
date=['1/3/15','2/5/15','3/6/15','4/8/16']
dist=[5,4,11,12]
dd=list(zip(date,dist))
df=pd.DataFrame(dd,columns=['Date','Dist'])
print(df)
out:
Date Dist
0 1/3/15 5
1 2/5/15 4
2 3/6/15 11
3 4/8/16 12
I would like to be able to get only the dist > 10 and the corresponding date as so:
Date Dist
2 3/6/15 11
3 4/8/16 12
I've tried the following:
dd10=pd.DataFrame(df['Dist']>10)
print(dd10)
Which only results in:
0 False
1 False
2 True
3 True
Name: Dist, dtype: bool
How can I get the desired result as an int. with the corresponding date instead of a bool?