Why null value counts are different in pandas and sql?

Viewed 39

I was comparing null values in pandas and sql. But, for a single column, both values are not same. There are not null values for sql but there are for pandas. I tried both .isnull() and .isna() but result did not change.

df_contacts.isna().sum()[df_contacts.isna().sum()>0].plot(kind='bar')
# or
df_contacts.isnull().sum()[df_contacts.isnull().sum()>0].plot(kind='bar')

enter image description here

SELECT c.Gender, COUNT(c.Gender) as cnt
FROM Contacts c
GROUP BY c.Gender 
ORDER BY cnt DESC

enter image description here

Value counts are not same also. Why NULL value count for SQL is not correct?

0 Answers
Related