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

Support deleting rows and columns from the dataframe #631

Open
Tracked by #962 ...
pngwn opened this issue Feb 16, 2022 · 19 comments
Open
Tracked by #962 ...

Support deleting rows and columns from the dataframe #631

pngwn opened this issue Feb 16, 2022 · 19 comments
Assignees
Labels
💾 Dataframe enhancement New feature or request svelte Frontend-related issue (JS)
Milestone

Comments

@pngwn
Copy link
Member

pngwn commented Feb 16, 2022

Is your feature request related to a problem? Please describe.
I would like to be able to delete rows and/or columns when suing the dataframe component.

Follow on from #588.

@abidlabs abidlabs added the enhancement New feature or request label Feb 17, 2022
@abidlabs
Copy link
Member

How about just adding "Delete Column" and "Delete Row" buttons next to the "New Column" and "New Row" buttons we already have. They would be disabled unless a cell is selected?

image

@abidlabs
Copy link
Member

Quick followup (seems to small to create a separate issue): do we actually want to display "null" when the dataframe is instantiated? Just leave the cells blank would look cleaner

@pngwn
Copy link
Member Author

pngwn commented Feb 17, 2022

I'm not entirely sure where the null is coming from, I'm assuming that data is being provided exactly like that from the backend, which is why it is displayed. The frontend does not insert nulls unless they are already there. I can convert any fasley value that isn't a number to an empty string if we think that makes the most sense..

@abidlabs
Copy link
Member

Looks like it originates here:

gradio/gradio/inputs.py

Lines 1421 to 1424 in 21e0bd1

self.default = (
default
if default is not None
else [[None for _ in range(self.col_count)] for _ in range(self.row_count)]

Python's None gets converted to Javascript's null.

I think a better way would be to just have the default in the Python be the empty string? Cc @aliabid94 for his thoughts

@abidlabs abidlabs added this to the 2.9.0 milestone Feb 18, 2022
@pngwn pngwn mentioned this issue Apr 8, 2022
8 tasks
@omerXfaruq
Copy link
Contributor

Assigning this to you @pngwn as it seems you are already working on it, feel free to drop it.

@pngwn pngwn mentioned this issue May 6, 2022
31 tasks
@abidlabs
Copy link
Member

abidlabs commented May 9, 2022

We've decided we'll leave this for post 3.0

@abidlabs abidlabs removed this from the 3.0 milestone May 9, 2022
@omerXfaruq omerXfaruq added this to the 2023 milestone May 9, 2022
@pngwn pngwn mentioned this issue May 10, 2022
22 tasks
@abidlabs abidlabs added the svelte Frontend-related issue (JS) label Jul 11, 2022
@taesiri
Copy link

taesiri commented Jan 23, 2023

+1

I'd love to see this happen sometime soon.

@abidlabs abidlabs removed this from the 3.x milestone Mar 17, 2023
@abidlabs abidlabs added this to the Component Cleanup milestone Jul 9, 2023
@hannahblair hannahblair assigned pngwn and unassigned pngwn Jul 31, 2023
@abidlabs abidlabs removed this from the Component Cleanup milestone Aug 10, 2023
@abidlabs abidlabs added this to the Component Cleanup milestone Aug 21, 2023
@abidlabs abidlabs self-assigned this Aug 21, 2023
@ColabDog
Copy link

ColabDog commented Sep 9, 2023

👍 on this feature - not sure if there's a way to work around? I potentially thought about adding a GR button but unsure of how Gradio can handle state changes like this.

@abidlabs abidlabs assigned abidlabs and unassigned abidlabs Oct 17, 2023
@abidlabs abidlabs removed this from the Component Cleanup milestone Nov 2, 2023
@abidlabs abidlabs removed their assignment Jan 3, 2024
@zhangbo2008
Copy link

it is very useful to add delete row/column button .Hopefully.

@abidlabs abidlabs added this to the Gradio 5️⃣ milestone Jul 11, 2024
@wendytang
Copy link

+1 looking forward to this feature

@nprime496
Copy link

+1

2 similar comments
@ssmmoo1
Copy link

ssmmoo1 commented Aug 1, 2024

+1

@SamSweere
Copy link

+1

@richjames0
Copy link

+1 I have a strong need for this right now

@pngwn pngwn modified the milestones: Gradio 5, Gradio 5.x Sep 13, 2024
@lhoestq
Copy link

lhoestq commented Sep 18, 2024

Would be cool to support this. I use a DataFrame to let users define dataset fields and types to generate in my dataset rewriter app, and being able to remove rows would be nice (also the ability to name the axis and make the name appear on the buttons would be a cool bonus)

@pngwn
Copy link
Member Author

pngwn commented Sep 18, 2024

Could you elaborate on the last part @lhoestq?

@lhoestq
Copy link

lhoestq commented Sep 19, 2024

My last part is unrelated to the OP issue, I created #9394 instead

Still, very interested in the ability to delete rows/columns :)

@dwipper
Copy link

dwipper commented Sep 20, 2024

+1

1 similar comment
@Zackiss
Copy link

Zackiss commented Sep 22, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💾 Dataframe enhancement New feature or request svelte Frontend-related issue (JS)
Projects
None yet
Development

No branches or pull requests