Suppose i have the following dataframe:
Date Open High Low Close Volume min max Loc
Date
2020-06-15 14:00:00 2020-06-15 14:00:00 0.000123 0.000130 0.000121 0.000128 1467828.0 0.00012081 0.00013040 0
2020-06-15 18:00:00 2020-06-15 18:00:00 0.000128 0.000129 0.000123 0.000125 1264642.0 0 0 1
2020-06-15 22:00:00 2020-06-15 22:00:00 0.000125 0.000126 0.000122 0.000123 723738.0 0 0 2
I'm trying to create a new dataframe where:
- The data should be the columns
Open,min,maxLocbut ONLY whereminandmaxare > 0. - The index of the dataframe should be the column
Loc
Now i know that to create a Dataframe from another dataframe i can use pandas.concat() but i don't know how to set the conditions i explained above. Can anyone help me out on this?
Expected output example:
Loc Open min max
0 0.000123 0.00012081 0.00013040