Skip to content

Dask dataframe 'describe()' option fails for 'object' dtype  #4401

Closed

Description

@GermanCM

If I look at the documentation: http://docs.dask.org/en/latest/dataframe-api.html, it seems to be that 'object' dtypes should be accepted with the 'describe()' option by means of this sentence: "For object data (e.g. strings or timestamps), the result’s index will include count, unique, top, and freq", but as I can see in one of my examples, it does not work yet, giving the following error message: "ValueError: DataFrame contains only non-numeric data."
Any news about it so far? Thanks in advance.

Activity

  1. mrocklin commented on Feb 19, 2019

    @mrocklin
    Member

    It looks like we don't currently do anything for object dtype data

    In [1]: import dask                                                                                                
    
    In [2]: df = dask.datasets.timeseries()                                                                            
    
    In [3]: df.head()                                                                                                  
    Out[3]: 
                           id    name         x         y
    timestamp                                            
    2000-01-01 00:00:00  1026  Oliver  0.857227  0.602934
    2000-01-01 00:00:01   990  George  0.542299  0.947545
    2000-01-01 00:00:02   982  Victor  0.034715 -0.871700
    2000-01-01 00:00:03  1013     Ray  0.923782  0.592789
    2000-01-01 00:00:04   992  Oliver  0.907002  0.016452
    
    In [4]: df.describe()                                                                                              
    Out[4]: 
    Dask DataFrame Structure:
                      id        x        y
    npartitions=1                         
                   int64  float64  float64
                     ...      ...      ...
    Dask Name: describe, 525 tasks
    
    In [5]: df.describe().compute()                                                                                    
    Out[5]: 
                     id             x             y
    count  2.592000e+06  2.592000e+06  2.592000e+06
    mean   9.999788e+02  7.694701e-04 -1.430254e-04
    std    3.162041e+01  5.771207e-01  5.773583e-01
    min    8.350000e+02 -9.999995e-01 -9.999996e-01
    25%    9.790000e+02 -4.935266e-01 -4.926832e-01
    50%    1.000000e+03  5.384249e-03  7.559225e-03
    75%    1.022000e+03  5.054279e-01  5.048796e-01
    max    1.166000e+03  9.999998e-01  9.999999e-01

    docstrings are copied from pandas. See #1815

    If you have any interest in improving the situation that would be very welcome.

  2. added
    documentation
    good first issue
    on Apr 30, 2019
  3. martindurant commented on Apr 30, 2019

    @martindurant
    Member

    This should be a quick fix to the docs

  4. added a commit that references this issue on Apr 30, 2019
    1f84dfa
  5. almaleksia commented on May 5, 2019

    @almaleksia
    Contributor

    Hi, it would be useful to have describe for categorical columns, I presume many people miss it, myself included. I think I can add it, shall I?

  6. mrocklin commented on May 5, 2019

    @mrocklin
    Member

    That would be very welcome @almaleksia !

  7. almaleksia commented on May 6, 2019

    @almaleksia
    Contributor

    @mrocklin thank you, I hope I'll finish this by the end of this week.

  8. mrocklin commented on May 6, 2019

    @mrocklin
    Member

    Great! I'm also very glad to see you working on Dask again.

  9. added a commit that references this issue on May 7, 2019
    cae23c2
  10. added a commit that references this issue on May 14, 2019
    502ce86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dataframedocumentationgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions