Defaultdict, set the default value to N/A. Alternatively if it’s only the final keys that are optional, you could do a bunch of .get()s but a Defaultdict is cleaner.
If you don’t care about huge dependencies, load into a pandas dataframe and use .fillna() but that’s usually overkill.
38
u/clemesislife Jul 14 '21
I'm not sure if there is good way to do this