Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove rows where at least one zero value

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try doing this:

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

or

df[df != 0].dropna()

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading