I\'m trying to replace some NaN values in my data with an empty list []. However the list is represented as a str and doesn\'t allow me to properly apply the len() function.
You can also use a list comprehension for this:
d['x'] = [ [] if x is np.NaN else x for x in d['x'] ]