Dropping rows of columns containing critical info

In this lecture, Rain_today had 142199 and Rain_tomorrow had 142193 non-null values. So, why after dropna, the rows reduced to 140787 ?. Shouldn’t it reduce to a number which is minimum among them i.e. 142193 so that data is not lost in the process?

Hey…
Let’s take a dataframe to understand this…

Id Rain_today Rain_tomorrow
1 yes no
2 null yes
3 no null
4 no no
5 null null
6 yes yes
7 yes null
8 no null
9 no no
10 null null

As you can see there are 10 rows…
Now Rain_today has 3 null values and 7 non-null values…
Rain_tomorrow has 5 null values and 5 non-null values

Now we don’t need the rows which do not provide us enough information to make predictions so we are going to remove the rows in which either Rain_today or Rain_tomorrow is null

After doing so…

Id Rain_today Rain_tomorrow
1 yes no
4 no no
6 yes yes
9 no no

We now only have 4 rows of data which is not the minimum of non-null values of Rain_today or Rain_tomorrow

Now this shows that it is not necessary that after removing the non-null values…the number of rows is minimum of the columns having non-null values on which the data has been removed…

Hope you understand…

Got it. Thank You! @vinaypratapsingh609