Okay simple problem. I used the count
function in pandas to count the number of samples and group them by cruise
and year
as can be seen below:
eDNADFdateCruise = eDNADF.groupby(['year', 'cruise_id'])['sample_name'].count()
However, now what I want to do is count the number of null values in a given column (such as extraction_no
) and group those in the same way.
I tried this:
eDNADFBlanksSummary = eDNADF.groupby(['year', 'cruise_id'])df['extraction_no'].isna().sum()
Which I thought would count the number of null values for the extraction_no
column and group them by cruise and year. However, this simply returned a syntax error so I am a bit lost.