Open Holer90 opened 1 year ago
take
Hi, thanks for your report. Please wait for consensus before submitting a pr
Hi, thanks for your report. Please wait for consensus before submitting a pr
Will do.
For reference, the code is (mostly) available in pandas/io/formats/glimpse.py
in my fork if its interesting while considering the consensus.
I think this would be a great feature for pandas
. In R it gives helpful data summary overview for R DataFrames
and it makes sense to have a similar feature for pandas
.
Plus one.
Originally opened the issue in the siuba repo. Would be great to see this added here.
Just a general comment: It's not only about the feature, we have to be comfortable maintaining it as well (long-term speaking)
Just a general comment: It's not only about the feature, we have to be comfortable maintaining it as well (long-term speaking)
Fully understand. Regarding this, it has been designed with an architecture that is 1-to-1 with the info()
function, which should make it easier to both maintain and understand.
Isnt't this the same of doing df.T
or in full df.transpose()
?
Isnt't this the same of doing
df.T.head().T # or df.transpose.head()
?
Would that not only print the first 5 columns? Also, this would print/show all the data?
@phofl has any discussion happened regarding this feature ?
Late to the show here @Holer90 but I have written a .glimpse
function in the pytimetk
package that does this just like with dplyr. The issue with the polars
implementation of .glimpse()
is that if you transform your pandas.DataFrame into a polars.DataFrame the dtypes are not like for like.
Feature Type
[X] Adding new functionality to pandas
[ ] Changing existing functionality in pandas
[ ] Removing existing functionality in pandas
Problem Description
Pandas is missing a quick and easy way to get an overview of multi-column data. Fortunate, the
R
-community has found a solution:dplyr::glimpse()
. Link to dplyr.Example:
Feature Description
I have implemented the
glimpse()
function based on theinfo()
function for bothDataFrame
andSeries
. I have also slightly extended the functionality to include the following options:An example of the extended functionality:
Alternative Solutions
The functionality could be implemented in a separate package and monkey-patched into
pandas
, but this solution would not make the function easily accessible to the vast majority of people usingpandas
.Additional Context
I will provide a pull request implementing this functionality shortly.
In
siuba
, which is adplyr
implementation in python, there is an open issue to Support glimpse function, which shows the desire for this functionality in the python/pandas community.Edit: The
glimpse
function is also implemented in polars, which also highlights the desire for this functionality.