pandas: powerful Python data analysis toolkit - 0.25
applications. 3.1.1 Data structures Dimensions Name Description 1 Series 1D labeled homogeneously-typed array 2 DataFrame General 2D labeled, size-mutable tabular structure with potentially heterogeneously-typed '2013-01-06'], dtype='datetime64[ns]', freq='D') In [7]: df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD')) In [8]: df Out[8]: A B C D 2013-01-01 1.832747 1.515386 1.793547 -0 dtype='float32'), ...: 'D': np.array([3] * 4, dtype='int32'), ...: 'E': pd.Categorical(["test", "train", "test", "train"]), ...: 'F': 'foo'}) ...: In [10]: df2 Out[10]: A B C D E F 0 1.0 2013-01-020 码力 | 698 页 | 4.91 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.14.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 8.4 Panel4D (Experimental) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981 28.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1056 Out[8]: Index([1, 2, 3], dtype=’object’) Previously, the above operation would return Int64Index. If you’d like to do this manually, use Index.astype() In [9]: i[[0,1,2]].astype(np.int_) Out[9]: Int64Index([10 码力 | 1349 页 | 7.67 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.17.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 ii 9.4 Panel4D (Experimental) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1373 34.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1465 duration of the timedelta in seconds. See here • Period and PeriodIndex can handle multiplied freq like 3D, which corresponding to 3 days span. See here • Development installed versions of pandas will now have0 码力 | 1787 页 | 10.76 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 8.4 Panel4D (Experimental) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1181 32.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1260 values (rather than previously -1), (GH8689) In [1]: s = Series(date_range(’20130101’,periods=5,freq=’D’)) In [2]: s.iloc[2] = np.nan In [3]: s Out[3]: 0 2013-01-01 1 2013-01-02 2 NaT 3 2013-01-04 40 码力 | 1579 页 | 9.15 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.15.1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 8.4 Panel4D (Experimental) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1162 32.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1240 values (rather than previously -1), (GH8689) In [1]: s = Series(date_range(’20130101’,periods=5,freq=’D’)) In [2]: s.iloc[2] = np.nan In [3]: s Out[3]: 0 2013-01-01 1 2013-01-02 2 NaT 3 2013-01-04 40 码力 | 1557 页 | 9.10 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.13.1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 8.4 Panel4D (Experimental) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892 28.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963 Major_axis axis: 2000-01-03 00:00:00 to 2000-01-07 00:00:00 Minor_axis axis: A to D In [42]: panel[’ItemA’] Out[42]: A B C D 2000-01-03 -0.700262 -0.159861 -0.178315 1.495435 2000-01-04 -0.237922 0.2862300 码力 | 1219 页 | 4.81 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.19.1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 9.3.1 From 3D ndarray with optional axis labels . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 9.3.2 From to DataFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 9.4 Panel4D and PanelND (Deprecated) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 IO / Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1501 35.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15010 码力 | 1943 页 | 12.06 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.19.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 9.3.1 From 3D ndarray with optional axis labels . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 9.3.2 From to DataFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 9.4 Panel4D and PanelND (Deprecated) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 IO / Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1497 35.6 Panel4D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14980 码力 | 1937 页 | 12.03 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.7.3
...: ’two’, ’two’, ’one’, ’three’], .....: ’C’ : np.random.randn(8), ’D’ : np.random.randn(8)}) In [929]: df Out[929]: A B C D 0 foo one -0.541264 2.801614 1 bar one -0.722290 1.669853 2 foo two Dimen- sions Name Description 1 Series 1D labeled homogeneously-typed array 1 Time- Series Series with index containing datetimes 2 DataFrame General 2D labeled, size-mutable tabular structure with with potentially heterogeneously-typed columns 3 Panel General 3D labeled, also size-mutable array 4.1.1 Why more than 1 data structure? The best way to think about the pandas data structures is as flexible0 码力 | 297 页 | 1.92 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.7.2
Dimen- sions Name Description 1 Series 1D labeled homogeneously-typed array 1 Time- Series Series with index containing datetimes 2 DataFrame General 2D labeled, size-mutable tabular structure with with potentially heterogeneously-typed columns 3 Panel General 3D labeled, also size-mutable array 4.1.1 Why more than 1 data structure? The best way to think about the pandas data structures is as flexible ’c’, ’d’, ’e’]) In [229]: s Out[229]: 23 pandas: powerful Python data analysis toolkit, Release 0.7.2 a -0.284 b -1.537 c 0.163 d -0.648 e -1.703 In [230]: s.index Out[230]: Index([a, b, c, d, e]0 码力 | 283 页 | 1.45 MB | 1 年前3
共 32 条
- 1
- 2
- 3
- 4