Assume that I have the following dataframe:
+---+---------+------+------+------+
| | summary | col1 | col2 | col3 |
+---+---------+------+------+------+
| 0 | count | 10 | 10 | 10 |
+---+---------+------+------+------+
| 1 | mean | 4 | 5 | 5 |
+---+---------+------+------+------+
| 2 | stddev | 3 | 3 | 3 |
+---+---------+------+------+------+
| 3 | min | 0 | -1 | 5 |
+---+---------+------+------+------+
| 4 | max | 100 | 56 | 47 |
+---+---------+------+------+------+
How can I keep only the columns where count > 5, mean>4 and min>0 including the column summary as well?
The desired output is:
+---+---------+------+
| | summary | col3 |
+---+---------+------+
| 0 | count | 10 |
+---+---------+------+
| 1 | mean | 5 |
+---+---------+------+
| 2 | stddev | 3 |
+---+---------+------+
| 3 | min | 5 |
+---+---------+------+
| 4 | max | 47 |
+---+---------+------+