I use a filter to check for conditions in my dataframe so i can mark them.
filtering = (dfsamen.shift(0).moving=='movingToclose') & (more condtions)
dffilter = pd.Dataframe(data=filtering, columns = ['filter'])
dffilter['DateTime'] = dfsamen['DateTime']
Output:
filtering
4 False
5 False
6 True
7 True
dffilter
4 False 2018-06-03 06:33:38.593
5 False 2018-06-03 06:33:39.197
6 True 2018-06-03 06:33:40.597
7 True 2018-06-03 06:33:41.800
But later I use the same code with different condtions and it doesn't work
filtering2 = (dfsamen.shift(0).Input5==1) | (more conditions)
dffilter2 = pd.DataFrame(data=filtering2, columns=['filter2'])
dffilter2['DateTime'] = dfsamen['DateTime']
Output:
filtering2
4 False
5 True
6 True
7 True
dffilter2 (before the datetime is added)
Empty DataFrame
Columns: [filter2]
Index: []
dffilter2 (with datetime)
4 NaN 2018-06-03 06:33:38.593
5 NaN 2018-06-03 06:33:39.197
6 NaN 2018-06-03 06:33:40.597
7 NaN 2018-06-03 06:33:41.800
So why does my data dissapear in the second filter when i add it to the column eventhough the data exists in the filtering2?