-
Notifications
You must be signed in to change notification settings - Fork 48
feat: add dataframe.insert #770
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
Conversation
bigframes/dataframe.py
Outdated
column_count = len(self.columns) | ||
if loc > column_count: | ||
raise IndexError( | ||
f"index {loc} is out of bounds for axis 0 with size {column_count}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
axis 0 doesn't exist in this context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this is the message pandas used for insert for some reason. Maybe just mean the columns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
bigframes/dataframe.py
Outdated
|
||
block = df._get_block() | ||
value_columns = typing.cast(List, block.value_columns) | ||
value_columns = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just List.insert() can do the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕
Docs screenshot:
https://screenshot.googleplex.com/44Hv89QdsGxbKaS
https://screenshot.googleplex.com/8sdZyxEcCzxd2ac