You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish there was some way to ensure a DataFrame has the same schema that would be inferred from a list of dataclass objects, if the list happens to be empty.
Feature Description
One possibility is to allow passing the dataclass as pd.DataFrame(dtype=Point2D). Ref #4464.
Note that while this is similar to #4464 (and possibly blocked by #4464), I don't think it's a duplicate, since there's still the issue of building the same dtype schema that would be inferred for a dataclass object, even if we had compound dtypes.
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
I wish there was some way to ensure a DataFrame has the same schema that would be inferred from a list of dataclass objects, if the list happens to be empty.
Feature Description
One possibility is to allow passing the dataclass as
pd.DataFrame(dtype=Point2D)
. Ref #4464.Note that while this is similar to #4464 (and possibly blocked by #4464), I don't think it's a duplicate, since there's still the issue of building the same dtype schema that would be inferred for a dataclass object, even if we had compound dtypes.
Alternative Solutions
Current workaround:
Additional Context
No response
The text was updated successfully, but these errors were encountered: