If you're dealing with data from a file, you can check the na_values
argument in the load functions (example with pd.read_csv())
df = pd.read_csv('examplefile.csv', na_values= 'not applicable')
This will tell pandas to treat every single cell that has 'not applicable' in it as a nan.
If your dataframe is something you've generated inside the program, you can change the values where 'not applicable' appears with pd.replace()
This will change the value you tell it to another value you tell the function:
df.replace('not applicable', np.nan, inplace=True)
The inplace argument makes it so the dataframe gets updated, instead of returning it. if you don't want to use it, you can do df = df.replace('not applicable', np.nan)
Here, I've used numpy's NaN as the replacement, but you can tell it to replace with any value you want.
For changing the data type, you can use pd.astype()