I have an example data as:
datetime column1. column2
2020-01-01. 5. [0,0,0,1]
2020-01-02. 4. [0,0,0,0]
2020-01-03. 10. [1,1,1,0]
2020-01-04. 2. [1,1,1,1]
I want a new column called action which assumes: 1 if column1 values are below 3 and above 5 otherwise the df.column2.any(axis=1) values.
The example output should look like this:
datetime column1. column2 action
2020-01-01. 5. [0,0,0,1]. 1
2020-01-02. 2. [0,0,0,0]. 1
2020-01-03. 10. [1,1,1,0]. 1
2020-01-04. 4. [0,0,0,0] 0