Forking and running your repl yields this error:
File "main.py", line 6, in <module>
demographic_data_analyzer.calculate_demographic_data()
File "/home/runner/boilerplate-demographic-data-analyzer-4/demographic_data_analyzer.py", line 54, in calculate_demographic_data
top_IN_occupation = occupation_total.idxmax()
File "/home/runner/boilerplate-demographic-data-analyzer-4/venv/lib/python3.8/site-packages/pandas/core/series.py", line 2110, in idxmax
i = nanops.nanargmax(com.values_from_object(self), skipna=skipna)
File "/home/runner/boilerplate-demographic-data-analyzer-4/venv/lib/python3.8/site-packages/pandas/core/nanops.py", line 69, in _f
return f(*args, **kwargs)
File "/home/runner/boilerplate-demographic-data-analyzer-4/venv/lib/python3.8/site-packages/pandas/core/nanops.py", line 875, in nanargmax
result = values.argmax(axis)
ValueError: attempt to get argmax of an empty sequence
exit status 1
Backtracking from where the error began in your code:
File "/home/runner/boilerplate-demographic-data-analyzer-4/demographic_data_analyzer.py", line 54, in calculate_demographic_data
top_IN_occupation = occupation_total.idxmax()
you should print the culprit, occupation_total
, which yields:
Series([], Name: occupation, dtype: int64)
Backtracking another step and printing the previous dataframe:
Empty DataFrame
Columns: [age, workclass, fnlwgt, education, education-num, marital-status, occupation, relationship, race, sex, capital-gain, capital-loss, hours-per-week, native-country, salary]
Index: []
So, you have an empty data frame to start your analysis of Indian occupations and you need to determine why that is the case.