Skip to content

Column constructor #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MarcoGorelli opened this issue Mar 30, 2023 · 1 comment · Fixed by #148
Closed

Column constructor #121

MarcoGorelli opened this issue Mar 30, 2023 · 1 comment · Fixed by #148

Comments

@MarcoGorelli
Copy link
Contributor

MarcoGorelli commented Mar 30, 2023

For constructing DataFrames, we have DataFrame.from_dict

How about constructing a Column? Example of where this would be needed:

https://github.com/mwaskom/seaborn/blob/5d9f37159bbd3ac44c8c8a06825583ba25648525/seaborn/_oldcore.py#L1217-L1220

        for var in axis_variables:
            other_var = {"x": "y", "y": "x"}[var]

            converter = pd.Series(index=self.plot_data.index, name=var, dtype=object)
@rgommers
Copy link
Member

Seems like we need this. One comment during today's call was that these kind of constructors are quite messy in existing libraries, mainly for two reasons: they take a large number of types of input (arrays, scalars, sequences, generators, etc.) as well as do dtype inference on the contents. It looks like we want to avoid that, by only accepting well-defined input types (probably sequence and array?) and having the caller specify the dtype. Each element of input sequences must be of that dtype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants