pandas: powerful Python data analysis toolkit - 0.24.0
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 speeds of different birds. >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) (continues pandas: powerful Python data analysis toolkit, Release 0.24.0 (continued from previous page) >>> s2 falcon 345.0 eagle 200.0 duck 30.0 dtype: float64 Now, to combine the two datasets and view the highest0 码力 | 2973 页 | 9.90 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0.0
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 3015 页 | 10.78 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.1.1
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 3231 页 | 10.87 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.1.0
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 3229 页 | 10.87 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.25.0
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 2827 页 | 9.62 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.25.1
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 2833 页 | 9.65 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 3091 页 | 10.16 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0.4
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 3081 页 | 10.24 MB | 1 年前3pandas: powerful Python data analysis toolkit -1.0.3
'Carnivora', 58)], ...: index=['falcon', 'parrot', 'lion', 'monkey', 'leopard'], ...: columns=('class', 'order', 'max_speed')) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389.0 >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.0 highest speeds of the birds across the two datasets >>> s1.combine(s2, max) duck NaN eagle 200.0 falcon 345.0 dtype: float64 In the previous example, the resulting value for duck is missing, because0 码力 | 3071 页 | 10.10 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.3.2
.: ], ...: index=["falcon", "parrot", "lion", "monkey", "leopard"], ...: columns=("class", "order", "max_speed"), ...: ) ...: In [2]: df Out[2]: class order max_speed falcon bird Falconiformes 389 StataWriter117 Low-level writer for version 117 files. Examples >>> df = pd.DataFrame({'animal': ['falcon', 'parrot', 'falcon', ... 'parrot'], ... 'speed': [350, 18, 361, 15]}) >>> df.to_stata('animals.dta') StataReader >>> s1 = pd.Series({'falcon': 330.0, 'eagle': 160.0}) >>> s1 falcon 330.0 eagle 160.0 dtype: float64 >>> s2 = pd.Series({'falcon': 345.0, 'eagle': 200.0, 'duck': 30.0}) >>> s2 falcon 345.0 eagle 200.00 码力 | 3509 页 | 14.01 MB | 1 年前3
共 19 条
- 1
- 2