0

Here is my data frame

                          Param1                 Param2    datetime
ts                                                                            
1669246574000               6.06                  -1.80  22-24-11 01:36:14 UTC
1669242973000               6.50                  -1.73  22-24-11 00:36:13 UTC
...                          ...                    ...                    ...
1668918964000               6.00                   0.00  22-20-11 06:36:04 UTC
1668915364000               0.00                   1.6   22-20-11 05:36:04 UTC

Output with removed zero values

                          Param1                 Param2    datetime
ts                                                                            
1669246574000               6.06                  -1.80  22-24-11 01:36:14 UTC
1669242973000               6.50                  -1.73  22-24-11 00:36:13 UTC
devaskim
  • 492
  • 3
  • 10

1 Answers1

1

Try doing this:

df[(df != 0).all(1)]

or

df[df != 0].dropna()

Paul
  • 1,801
  • 1
  • 12
  • 18
  • `df[(df != 0).all(1)]` helps, thanks. My fault was that I didn't assign result of operation to `df` – devaskim Dec 15 '22 at 08:43