Skip to content

DataFrame.assign() should allow a list and a range #1248

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
Dr-Irv opened this issue Jun 13, 2025 · 0 comments · Fixed by #1250
Closed

DataFrame.assign() should allow a list and a range #1248

Dr-Irv opened this issue Jun 13, 2025 · 0 comments · Fixed by #1250

Comments

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jun 13, 2025

Describe the bug

DataFrame.assign() should allow lists and ranges

To Reproduce

import pandas as pd
df = pd.DataFrame({"a": [1,2,3]})
df = df.assign(b=lambda df: range(len(df)), c=lambda df: [10,20,30])

Need to update IntoColumn in _typing.pyi to include list[Scalar] and range

Please complete the following information:

  • OS: Windows 11
  • python version 3.10
  • pyright 1.1.400
  • version of installed pandas-stubs : development version
@Dr-Irv Dr-Irv changed the title DataFrame.assign( should allow a list and a range DataFrame.assign() should allow a list and a range Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant