From 5c5161f8f9415dbfb77609c91060616fff223145 Mon Sep 17 00:00:00 2001 From: Bert Palm <bert.palm@ufz.de> Date: Wed, 15 Apr 2020 03:12:21 +0200 Subject: [PATCH] mini starting example --- Readme.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index ac41cd7..2de189d 100644 --- a/Readme.md +++ b/Readme.md @@ -20,7 +20,62 @@ Features * behaves quite like a pandas.DataFrame * additional align locator (`.aloc[]`) - +TL;DR +----- +**get it** +``` +>>> from dios import DictOfSeries +``` +**empty** +``` +>>> DictOfSeries() +Empty DictOfSeries +Columns: [] + +>>> DictOfSeries(columns=['x', 'y']) +Empty DictOfSeries +Columns: ['x', 'y'] + +>>> DictOfSeries(columns=['x', 'y'], index=[3,4,5]) + x | y | +====== | ====== | +3 NaN | 3 NaN | +4 NaN | 4 NaN | +5 NaN | 5 NaN | +``` +**with data** +``` +>>> DictOfSeries([range(4), range(2), range(3)]) + 0 | 1 | 2 | +==== | ==== | ==== | +0 0 | 0 0 | 0 0 | +1 1 | 1 1 | 1 1 | +2 2 | | 2 2 | +3 3 | | | + +>>> DictOfSeries(np.random.random([2,4])) + 0 | 1 | +=========== | =========== | +0 0.112020 | 0 0.509881 | +1 0.108070 | 1 0.285779 | +2 0.851453 | 2 0.805933 | +3 0.138352 | 3 0.812339 | + +>>> DictOfSeries(np.random.random([2,4]), columns=['a','b'], index=[11,12,13,14]) + a | b | +============ | ============ | +11 0.394304 | 11 0.356206 | +12 0.943689 | 12 0.735356 | +13 0.791820 | 13 0.066947 | +14 0.759802 | 14 0.496321 | + +>>> DictOfSeries(dict(today=['spam']*3, tomorrow=['spam']*2)) + today | tomorrow | +======= | ========== | +0 spam | 0 spam | +1 spam | 1 spam | +2 spam | | +``` Pandas-like indexing -------------------- -- GitLab