Skip to content

Dataframes ready to be imported? #13370

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

Closed
amelio-vazquez-reina opened this issue Jun 5, 2016 · 1 comment
Closed

Dataframes ready to be imported? #13370

amelio-vazquez-reina opened this issue Jun 5, 2016 · 1 comment

Comments

@amelio-vazquez-reina
Copy link
Contributor

amelio-vazquez-reina commented Jun 5, 2016

Does Pandas come with any "sample" dataframes ready to be imported? Otherwise, does the library provide any utilities to quickly create them randomly? (aside from the usual np. random utils). I'm thinking of examples with timestamps, categorical and numerical data.

Alternatively, are there any recommended packages that can help users load "sample" dataframes/series/panels?

@jreback
Copy link
Contributor

jreback commented Jun 5, 2016

utilties to create testing data frames

In [2]: from pandas.util import testing as tm

In [3]: tm.make
tm.makeBoolIndex               tm.makeDateIndex               tm.makeMissingDataframe        tm.makePeriodFrame             tm.makeStringIndex             tm.makeUnicodeIndex
tm.makeCategoricalIndex        tm.makeFloatIndex              tm.makeMixedDataFrame          tm.makePeriodIndex             tm.makeStringSeries            
tm.makeCustomDataframe         tm.makeFloatSeries             tm.makeObjectSeries            tm.makePeriodPanel             tm.makeTimeDataFrame           
tm.makeCustomIndex             tm.makeIntIndex                tm.makePanel                   tm.makePeriodSeries            tm.makeTimeSeries              
tm.makeDataFrame               tm.makeMissingCustomDataframe  tm.makePanel4D                 tm.makeRangeIndex              tm.makeTimedeltaIndex          

In [3]: tm.makeTi
tm.makeTimeDataFrame   tm.makeTimeSeries      tm.makeTimedeltaIndex  

In [3]: tm.makeTimeDataFrame()
Out[3]: 
                   A         B         C         D
2000-01-03 -1.460311 -0.464734 -2.198671  0.768434
2000-01-04  0.192514  0.745945 -0.260240  0.553494
2000-01-05 -0.204317 -2.100117  0.482762 -0.680113
2000-01-06 -0.257809  2.904980 -1.054702 -0.855462
2000-01-07 -1.090030 -0.116390 -0.989414 -0.161191
2000-01-10 -0.045753  0.755095 -2.231809  0.599142
2000-01-11  0.015389  1.179409 -0.445605 -1.492777
2000-01-12 -1.097981  1.166901 -0.780713  0.049721
2000-01-13  0.806519  0.144259 -2.395092  0.879999
2000-01-14 -0.889756 -1.055778 -0.185147 -1.756858
2000-01-17 -0.085666 -0.343939  0.931116 -0.583236
2000-01-18 -0.429107 -0.961781  0.314267 -0.694172
2000-01-19  0.534720 -0.600291  2.361877 -1.413320
2000-01-20  0.494076 -1.397031 -0.156358 -1.913547
2000-01-21  0.923212 -0.519801 -0.193719  1.696393
2000-01-24 -0.409085 -0.120944 -0.273425 -0.403138
2000-01-25 -0.331534  1.530272  0.950747  1.584787
2000-01-26 -0.010242  0.438478  1.375064  1.307261
2000-01-27 -0.142622 -1.617633 -0.698369 -0.661196
2000-01-28 -0.059855 -1.075170  0.230901  0.587383
2000-01-31 -0.702173 -0.525622  0.556386 -0.943545
2000-02-01  0.548121 -0.268657  0.525702 -1.105843
2000-02-02  1.259266 -0.333930  0.161058 -0.097886
2000-02-03  0.122023  0.858570  0.919913  0.667828
2000-02-04  0.520518 -0.089728 -0.527429  0.441597
2000-02-07 -1.537155  0.574092  0.934734  0.635218
2000-02-08  0.148688 -2.635006 -0.380072 -1.152498
2000-02-09 -0.099199  1.136776  1.684748  0.592334
2000-02-10 -0.354402  1.569423  0.971752 -0.273893
2000-02-11 -0.613365  0.095510  1.174081  0.131692

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

No branches or pull requests

2 participants