My Pandas function is returning "None" as a result instead of the DataFrame that I am trying to filter using the function that I have written. Why is this so? And how can I resolve this? Thank you!
import pandas as pd
nz_data = pd.read_csv('research-and-development-survey-2016-2019-csv.csv', index_col = 2)
def count_of_mining_biz():
if "B_Mining" in nz_data[["Breakdown_category"]] and "Count of businesses" in nz_data[["Units"]]:
return nz_data.loc["2019", "RD_Value"]
print(count_of_mining_biz())
Here is how the data looks like.
I am trying to find out the RD Value in 2019 for the Mining industry. The reason why I have to set a conditional for the "Units" column is because there is another type of data that is not the count for the business mentioned.