Is it possible to create a sparse Pandas DataFrame that has columns both containing floats and strings? I.e, I have a dataframe:
df2 = pd.DataFrame({'A':[0., 1., 2., 0.],
'B': ['a','b','c','d']}, columns=['A','B'])
And I want to convert this to a sparse dataframe, but df2.to_sparse(fill_value=0.) gives:
ValueError: could not convert string to float: d
Is there any way to make this work?