pandas: powerful Python data analysis toolkit - 0.21.1
of note in each release. 1.1 v0.21.1 (December 12, 2017) This is a minor bug-fix release in the 0.21.x series and includes some small regression fixes, bug fixes and performance improvements. We recommend aggregated data In [98]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, ....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], ....: 'flag': [False, True] * 3}) ....: In [99]: code_groups = df.groupby('code') sorted_df = df.loc[agg_n_sort_order.index] In [102]: sorted_df Out[102]: code data flag 1 bar -0.21 True 4 bar -0.59 False 0 foo 0.16 False 3 foo 0.45 True 2 baz 0.33 False 5 baz 0.62 True Create0 码力 | 2207 页 | 8.59 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0.0
15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 (continues on next page) 482 Chapter 3. User Guide pandas: powerful Python data analysis toolkit aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df sorted_df = df.loc[agg_n_sort_order.index] In [124]: sorted_df Out[124]: code data flag 1 bar -0.21 True 4 bar -0.59 False 0 foo 0.16 False 3 foo 0.45 True 2 baz 0.33 False 5 baz 0.62 True Create0 码力 | 3015 页 | 10.78 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.25.0
15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 Pivoting with single aggregations aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df sorted_df = df.loc[agg_n_sort_order.index] In [124]: sorted_df Out[124]: code data flag 1 bar -0.21 True 4 bar -0.59 False 0 foo 0.16 False 3 foo 0.45 True 2 baz 0.33 False (continues on next page)0 码力 | 2827 页 | 9.62 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.25.1
15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 Pivoting with single aggregations aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df sorted_df = df.loc[agg_n_sort_order.index] In [124]: sorted_df Out[124]: code data flag 1 bar -0.21 True 4 bar -0.59 False 0 foo 0.16 False 3 foo 0.45 True 2 baz 0.33 False 5 baz 0.62 True Create0 码力 | 2833 页 | 9.65 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0.4
(December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2594 5.6 Version 0.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2599 15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 [20 rows x 6 columns] Pivoting aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df0 码力 | 3081 页 | 10.24 MB | 1 年前3pandas: powerful Python data analysis toolkit -1.0.3
(December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2580 6.6 Version 0.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2585 15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 [20 rows x 6 columns] Pivoting aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df0 码力 | 3071 页 | 10.10 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0
(December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2599 5.6 Version 0.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2604 15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 [20 rows x 6 columns] Pivoting aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df0 码力 | 3091 页 | 10.16 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.1.1
(December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2737 5.7 Version 0.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2742 15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 [20 rows x 6 columns] Pivoting aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df0 码力 | 3231 页 | 10.87 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.1.0
(December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2735 5.7 Version 0.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2740 15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 [20 rows x 6 columns] Pivoting aggregated data In [120]: df = pd.DataFrame({'code': ['foo', 'bar', 'baz'] * 2, .....: 'data': [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: 'flag': [False, True] * 3}) .....: In [121]: code_groups = df0 码力 | 3229 页 | 10.87 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.3.3
(December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3103 5.9 Version 0.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3107 15 key0 row3 item1 col1 0.31 0.23 16 key0 row0 item2 col3 0.86 0.01 17 key0 row4 item0 col3 0.64 0.21 18 key2 row2 item2 col0 0.13 0.45 19 key0 row2 item0 col4 0.37 0.70 [20 rows x 6 columns] Pivoting [120]: df = pd.DataFrame( .....: { .....: "code": ["foo", "bar", "baz"] * 2, .....: "data": [0.16, -0.21, 0.33, 0.45, -0.59, 0.62], .....: "flag": [False, True] * 3, .....: } .....: ) .....: In [121]:0 码力 | 3603 页 | 14.65 MB | 1 年前3
共 133 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14