I was trying to remove b'NA' from default pandas na_values. They are defined in pandas._libs.parsers. I did it by importing the list and:
from pandas._libs.parsers import _NA_VALUES
disable_na_values = [b"NA"]
my_default_na_values = [
item.decode("UTF-8") for item in _NA_VALUES if item not in disable_na_values
]
df = pd.read_excel(filepath, keep_default_na=False, na_values=my_default_na_values)
It works and now, after excel/csv is imported the cells with "NA" value are ignored (country code for Nambia).
However what I don't understand, why are this na_values as bytes? And where are they used?
Thank you.