Skip to content
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

[BUG] check_column can't handle generator type column_names #1015

Open
Zeroto521 opened this issue Feb 11, 2022 · 0 comments
Open

[BUG] check_column can't handle generator type column_names #1015

Zeroto521 opened this issue Feb 11, 2022 · 0 comments

Comments

@Zeroto521
Copy link
Member

Brief Description

The map-like generator type of column_names could only use once.
The check_column consumes column_names data.
So column_names would be empty for the next steps.

Originally posted in #1014 (comment)

Minimally Reproducible Code

>>> import pandas as pd
>>> import janitor

>>> df = pd.DataFrame(columns=range(2))
>>> columns_range = range(2)
>>> janitor.utils.check_column(df, columns_range)
>>> columns_range
range(0, 2)

>>> columns_map = map(lambda x: x, range(2))
>>> janitor.utils.check_column(df, columns_map)
>>> <map at 0x1635c76d2e0>
>>> list(columns_map)
>>> []
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

No branches or pull requests

1 participant