'How to get all rows with null value in any column in pyspark

I need to find a way to get all rows that have null values in a pyspark dataframe.

For example, I have following dateframe:

   +-------+-------+-------+
   |   c_00|   c_01|   c_02|
   +-------+-------+-------+
 1 |  null |  0.141|  0.141|
 2 |   0.17|   0.17|   0.17|
 3 |   0.25|   null|   0.25|
 4 |  0.135|  0.135|  0.135|

I want all rows with null values in any column

   +-------+-------+-------+
   |   c_00|   c_01|   c_02|
   +-------+-------+-------+
 1 |  null |  0.141|  0.141|
 3 |   0.25|   null|   0.25|


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source