Open jorisvandenbossche opened 5 years ago
It seems like this would take a lot of effort to support.
Not that I care too much, but in principle we store the sparse values in sp_values
, and as long as the operations we do on those are also supported by EAs, that should work? I think many things (like isna, copy, take, unique) should all work, but the sparse index interaction might be more difficult.
(but clearly not a priority :). Although we should maybe raise in SparseDtype on that)
return libindex.get_value_at(self.sp_values, sp_loc)
FWIW in an upcoming cleanup branch I'm planning to get rid of libindex.get_value_at altogether. It is very similar to return com.maybe_box_datetimelike(self.sp_values[sp_loc])
.
You can create an SparseDtype with a ExtensionDtype as subtype:
but I don't think that you can actually create a SparseArray with that?
At least, there seems to be several places in the sparse code that assumes the subtype is a numpy dtype, and also creating one fails:
(although it is actually the repr that fails)
Is this something we would like to support? (cc @TomAugspurger )