Skip to content

ENH: a readable sample function or an improvement #54227

Open
@nagapv

Description

@nagapv

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

Hi All! We have efficient sampling options already and it's also possible to increase "display.max_colwidth" for readability.
But still, there are many situations, where those who work with text data needs a bit more readability. Look at the following screenshot:-
image

Feature Description

I've been doing EDA and also into QA of datasets for the past 5+ years, and spot checks, etc. are impossible without readability.

I've been using this simple, skeletal for loop function for a while. This is really useful. Can we improve on this?
image

def sample(df):
row = df.sample()
for i in row:
print(i)
print("", row[i].iloc[0], '\n')

Alternative Solutions

The only customization is display.max_colwidth, and pd.options.display.max_rows is not related to this for now.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNeeds DiscussionRequires discussion from core team before further actionOutput-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions