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

[features-] add command to hide repetitive columns #2453

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

midichef
Copy link
Contributor

@midichef midichef commented Jul 13, 2024

This is a command to hide any column that contains one value repeated in every row. Is this worth having? It's often the first command I run when opening large tables with such uninformative columns.

I'm not sure what to call the command. Right now it is hide-unvarying-cols, but perhaps hide-uniform-cols is better? hide-repetitive-cols is too hard to spell.

@frosencrantz
Copy link
Contributor

This would be a useful command. Thank you for proposing it @midichef!

I like it and would use it. Saul provided a useful suggestion when I asked in Issue 431 (2022 issues ago):

[howto] hide invariant columns

# Add longname-commands to VisiData to execute these methods
BaseSheet.addCommand(None, "select-duplicate-rows", "sheet.select_duplicate_rows()", "select each row that is a duplicate of a prior row")
BaseSheet.addCommand(None, "dedupe-rows", "vd.push(sheet.dedupe_rows())", "open new sheet in which only non-duplicate rows in the active sheet are included")
BaseSheet.addCommand(None, 'hide-unvarying-cols', 'sheet.hide_unvarying_cols()', 'hide any column that has multiple rows but only one distinct value')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands should all be on TableSheet instead of BaseSheet.

# Add longname-commands to VisiData to execute these methods
BaseSheet.addCommand(None, "select-duplicate-rows", "sheet.select_duplicate_rows()", "select each row that is a duplicate of a prior row")
BaseSheet.addCommand(None, "dedupe-rows", "vd.push(sheet.dedupe_rows())", "open new sheet in which only non-duplicate rows in the active sheet are included")
BaseSheet.addCommand(None, 'hide-unvarying-cols', 'sheet.hide_unvarying_cols()', 'hide any column that has multiple rows but only one distinct value')

vd.addMenuItems('''
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add this command to an appropriate place in the menu.

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

Successfully merging this pull request may close these issues.

4 participants