1
Imagine we have a CSV file called.csv data:
col1 col2 col3 col4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
33 44
import numpy as np
import pandas as pd
po = pd.read_csv('/dados.csv')
My goal is to better understand how to identify Nan/null data in a dataset.
Questions:
1.How to count how many 'Nan' data are in the above dataset?
2.How to count how many null data there are in the above dataset?
3.How to count how many data NOT 'Nan' exist in the above dataset?
4.How to count how many non-null data there are in the above dataset?
And the same questions above but per column?
I tried, for example,:
po[po['col4'].isna()].count()
thinking of accounts how many 'Nan' exist in column 4, but the answer was:
col1 2
col2 2
col3 1
col4 0
dtype: int64
What is wrong? How to answer the above questions?
@Noobsaibot : I don’t agree. I asked 4 questions regarding the above dataset (csv) in which each answer would be a line of code!
– Ed S
@Noobsaibot: My big question is How to count how many null/Nan data there are? And how many are not "Nan/null" to apply this in a larger dataset...
– Ed S
@Noobsaibot: I tried to apply here but did not understand the exit!
– Ed S