pandas: powerful Python data analysis toolkit - 0.25.0918029 -2.032644 0.599718 4.0 1.0 2013-01-04 -4.236791 -3.438204 -2.898548 2.0 0.0 2013-01-05 -6.632181 -5.992838 -4.258971 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data: \\\\\\\\\\\\\\\\\\\\\\\\\\Out[24]: ˓→ one two three a 0.547168 0.0 NaN b 0.642665 0.0 3.266105 c 0.680496 0.0 1.071124 d NaN 0.0 0.314701 In [25]: df.sub(column, axis=0) \\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\Out[25]: ˓→ one two three a 0.547168 0.0 NaN b 0.642665 0.0 3.266105 c 0.680496 0.0 1.071124 d NaN 0.0 0.314701 72 Chapter 3. Getting started pandas: powerful Python data0 码力 | 2827 页 | 9.62 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.25.1136964 -1.276600 -1.614256 4.0 1.0 2013-01-04 -2.933570 -2.113310 -1.455436 2.0 0.0 2013-01-05 -4.003868 -4.631248 -3.767124 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data: \\\\\\\\\\\\\\\\\\\\\\\\\Out[24]: ˓→ one two three a 0.110901 0.0 NaN b 1.048098 0.0 0.522232 c -0.228877 0.0 -1.602649 d NaN 0.0 -2.327381 In [25]: df.sub(column, axis=0) \\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\Out[25]: ˓→ one two three a 0.110901 0.0 NaN b 1.048098 0.0 0.522232 c -0.228877 0.0 -1.602649 d NaN 0.0 -2.327381 72 Chapter 3. Getting started pandas: powerful Python0 码力 | 2833 页 | 9.65 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.0>>> df = pd.DataFrame({"int_col": [1, 2, 3], ... "text_col": ["a", "b", "c"], ... "float_col": [0.0, 0.1, 0.2]}) >>> df.info(verbose=True)RangeIndex: 3 entries df = pd.DataFrame({"int_col": [1, 2, 3], ....: "text_col": ["a", "b", "c"], ....: "float_col": [0.0, 0.1, 0.2]}) ....: In [35]: df.info(verbose=True) RangeIndex: 789156 -0.015506 0.794371 4.0 1.0 2013-01-04 -2.256033 -3.470009 -4.308438 2.0 0.0 2013-01-05 -4.030171 -5.538649 -5.384829 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data: 0 码力 | 3015 页 | 10.78 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.1631739 -1.918963 0.180634 4.0 1.0 2013-01-04 -2.953780 -2.896224 -3.283132 2.0 0.0 2013-01-05 -4.301346 -4.235977 -4.525315 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN 2.1. 10 minutes to pandas 123 pandas: 'c': 2.} In [10]: pd.Series(d) Out[10]: a 0.0 b 1.0 c 2.0 dtype: float64 In [11]: pd.Series(d, index=['b', 'c', 'd', 'a']) Out[11]: b 1.0 c 2.0 d NaN a 0.0 dtype: float64 Note: NaN (not a number) ser3 Out[115]: b 2 c 4 d 6 dtype: int64 In [116]: np.remainder(ser1, ser3) Out[116]: a NaN b 0.0 c 3.0 d NaN dtype: float64 When a binary ufunc is applied to a Series and Index, the Series implementation0 码力 | 3231 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.0494845 -2.474497 -2.046234 4.0 1.0 2013-01-04 -2.150134 -1.616450 -2.597682 2.0 0.0 2013-01-05 -4.221386 -5.078109 -5.391629 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN 2.1. 10 minutes to pandas 123 pandas: 'c': 2.} In [10]: pd.Series(d) Out[10]: a 0.0 b 1.0 c 2.0 dtype: float64 In [11]: pd.Series(d, index=['b', 'c', 'd', 'a']) Out[11]: b 1.0 c 2.0 d NaN a 0.0 dtype: float64 Note: NaN (not a number) ser3 Out[115]: b 2 c 4 d 6 dtype: int64 In [116]: np.remainder(ser1, ser3) Out[116]: a NaN b 0.0 (continues on next page) 156 Chapter 2. User Guide pandas: powerful Python data analysis toolkit0 码力 | 3229 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0249345 -1.530136 -2.964163 4.0 1.0 2013-01-04 -1.342502 -2.019835 -1.978171 2.0 0.0 2013-01-05 -3.824777 -4.479973 -3.740665 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data: a -0.377535 0.0 NaN b -1.569069 0.0 -1.962513 c -0.783123 0.0 -0.250933 d NaN 0.0 -0.892516 In [25]: df.sub(column, axis=0) Out[25]: one two three a -0.377535 0.0 NaN b -1.569069 0.0 -1.962513 c c -0.783123 0.0 -0.250933 d NaN 0.0 -0.892516 Furthermore you can align a level of a MultiIndexed DataFrame with a Series. In [26]: dfmi = df.copy() In [27]: dfmi.index = pd.MultiIndex.from_tuples([(10 码力 | 3091 页 | 10.16 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.4764987 -1.114290 -1.885442 4.0 1.0 2013-01-04 -2.349451 -3.900529 -3.222337 2.0 0.0 2013-01-05 -3.167379 -4.368685 -6.070373 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data: a -0.377535 0.0 NaN b -1.569069 0.0 -1.962513 c -0.783123 0.0 -0.250933 d NaN 0.0 -0.892516 In [25]: df.sub(column, axis=0) Out[25]: one two three a -0.377535 0.0 NaN b -1.569069 0.0 -1.962513 c c -0.783123 0.0 -0.250933 d NaN 0.0 -0.892516 Furthermore you can align a level of a MultiIndexed DataFrame with a Series. In [26]: dfmi = df.copy() In [27]: dfmi.index = pd.MultiIndex.from_tuples([(10 码力 | 3081 页 | 10.24 MB | 1 年前3
pandas: powerful Python data analysis toolkit -1.0.3954175 -1.274885 -1.213291 4.0 1.0 2013-01-04 -3.221818 -3.530745 -2.354355 2.0 0.0 2013-01-05 -4.873611 -5.162619 -4.219376 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data: a -0.377535 0.0 NaN b -1.569069 0.0 -1.962513 c -0.783123 0.0 -0.250933 d NaN 0.0 -0.892516 In [25]: df.sub(column, axis=0) Out[25]: one two three a -0.377535 0.0 NaN b -1.569069 0.0 -1.962513 c c -0.783123 0.0 -0.250933 d NaN 0.0 -0.892516 Furthermore you can align a level of a MultiIndexed DataFrame with a Series. In [26]: dfmi = df.copy() In [27]: dfmi.index = pd.MultiIndex.from_tuples([(10 码力 | 3071 页 | 10.10 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.3.2861849 -3.104569 -1.494929 4.0 1.0 2013-01-04 -2.278445 -3.706771 -4.039575 2.0 0.0 2013-01-05 -5.424972 -4.432980 -4.723768 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN 2.1. 10 minutes to pandas 155 pandas: d = {"a": 0.0, "b": 1.0, "c": 2.0} In [10]: pd.Series(d) Out[10]: a 0.0 b 1.0 c 2.0 dtype: float64 In [11]: pd.Series(d, index=["b", "c", "d", "a"]) Out[11]: b 1.0 c 2.0 d NaN a 0.0 dtype: float64 pandas: powerful Python data analysis toolkit, Release 1.3.2 (continued from previous page) 0 0 0 0.0 1 0 3 5.0 2 2 3 NaN From a list of dataclasses New in version 1.1.0. Data Classes as introduced0 码力 | 3509 页 | 14.01 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.24.0Series([0, 1, np.nan], dtype="category") Previous Behavior In [3]: pd.concat([s, c]) Out[3]: 0 0.0 1 1.0 2 NaN 0 0.0 1 1.0 (continues on next page) 1.2. Backwards incompatible API changes 25 pandas: powerful array (GH12813) • Fixed bug in unique() handled signed zeros inconsistently: for some inputs 0.0 and -0.0 were treated as equal and for some inputs as different. Now they are treated as equal for all 238464 -1.486944 -0.984404 4.0 1.0 2013-01-04 -3.274925 -2.176662 -3.761681 2.0 0.0 2013-01-05 -3.907475 -3.835134 -5.846108 0.0 -1.0 2013-01-06 NaN NaN NaN NaN NaN Apply Applying functions to the data:0 码力 | 2973 页 | 9.90 MB | 1 年前3
共 91 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













