The inputs are a bunch of spreadsheets where the text 'N/A' is used for missing values. I need to document how many occurrences in each column using solely index number as I won't know the name of the columns. The first few columns will always be the same but the last few columns change depending on the type of spreadsheet.
df = pd.DataFrame([[1000, 'Jerry', 'BR1','BR1','N/A'],
[1001, 'N/A', 'N/A', 'BR1','N/A'],
['N/A', 'N/A', 'BR3', 'BR2','N/A'],
[1003, 'Perry','BR4','BR1','N/A']],
columns=['ID', 'Name', 'Branch', 'Member of','Status'])
I need to be able to do something like:
df.iloc[:, 10:].contains('N/A').count()
And also it's contrary:
~df.iloc[:, 10:].contains('N/A').count()
It should output something like value_counts
Name 2
Branch 1
Status 4
...etc.