pandas: powerful Python data analysis toolkit - 0.25DataFrame({'key': ['foo', 'foo'], 'lval': [1, 2]}) In [78]: right = pd.DataFrame({'key': ['foo', 'foo'], 'rval': [4, 5]}) In [79]: left Out[79]: key lval 0 foo 1 1 foo 2 In [80]: right Out[80]: key rval 0 [81]: pd.merge(left, right, on='key') Out[81]: key lval rval 0 foo 1 4 1 foo 1 5 2 foo 2 4 3 foo 2 5 Another example that can be given is: In [82]: left = pd.DataFrame({'key': ['foo', 'bar'], 'lval': [1 DataFrame({'key': ['foo', 'bar'], 'rval': [4, 5]}) In [84]: left Out[84]: key lval 0 foo 1 1 bar 2 In [85]: right Out[85]: key rval 0 foo 4 1 bar 5 In [86]: pd.merge(left, right, on='key') Out[86]: key lval0 码力 | 698 页 | 4.91 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.14.0implemented for bool dtypes • In HDFStore, select_as_multiple will always raise a KeyError, when a key or the selector is not found (GH6177) • df[’col’] = value and df.loc[:,’col’] = value are now completely 10:00:00 2013-09-05 10:00:00 1 In [78]: pivot_table(df, index=Grouper(freq=’M’, key=’Date’), ....: columns=Grouper(freq=’M’, key=’PayDay’), ....: values=’Quantity’, aggfunc=np.sum) ....: Out[78]: PayDay column from a table as a Series. – deprecated the unique method, can be replicated by select_column(key,column).unique() – min_itemsize parameter to append will now automatically create data_columns for0 码力 | 1349 页 | 7.67 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.0more details and example usage, see the Binary Excel files documentation. Closes GH8540. • The partition_cols argument in DataFrame.to_parquet() now accepts a string (GH27117) • pandas.read_json() now random.randn(8), "C": np.random.randn(8), }) g = df.groupby('A') # single key, returns SeriesGroupBy g['B'] # tuple of single key, returns SeriesGroupBy g[('B',)] # tuple of multiple keys, returns DataFrameGroupBy A tuple passed to DataFrame.groupby() is now exclusively treated as a single key (GH18314) • Removed Index.contains, use key in index instead (GH30103) • Addition and subtraction of int or integer-arrays0 码力 | 3015 页 | 10.78 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.1dictionaries, the selection of a single column is very similar to selection of dictionary values based on the key. You can create a Series from scratch as well: In [5]: ages = pd.Series([22, 35, 58], name="Age") air_quality_stations_coord table. Both tables have the column location in common which is used as a key to combine the information. By choosing the left join, only the locations available in the air_quality names or indices). In [23]: df1 = pd.DataFrame({'key': ['A', 'B', 'C', 'D'], ....: 'value': np.random.randn(4)}) ....: In [24]: df2 = pd.DataFrame({'key': ['B', 'D', 'D', 'E'], ....: 'value': np.random0 码力 | 3231 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.0dictionaries, the selection of a single column is very similar to selection of dictionary values based on the key. You can create a Series from scratch as well: In [5]: ages = pd.Series([22, 35, 58], name="Age") air_quality_stations_coord table. Both tables have the column location in common which is used as a key to combine the information. By choosing the left join, only the locations available in the air_quality names or indices). In [23]: df1 = pd.DataFrame({'key': ['A', 'B', 'C', 'D'], ....: 'value': np.random.randn(4)}) ....: In [24]: df2 = pd.DataFrame({'key': ['B', 'D', 'D', 'E'], ....: 'value': np.random0 码力 | 3229 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.4DataFrame({'key': ['foo', 'foo'], 'lval': [1, 2]}) In [78]: right = pd.DataFrame({'key': ['foo', 'foo'], 'rval': [4, 5]}) In [79]: left Out[79]: key lval 0 foo 1 1 foo 2 In [80]: right Out[80]: key rval pd.merge(left, right, on='key') Out[81]: key lval rval 0 foo 1 4 1 foo 1 5 2 foo 2 4 3 foo 2 5 Another example that can be given is: In [82]: left = pd.DataFrame({'key': ['foo', 'bar'], 'lval': DataFrame({'key': ['foo', 'bar'], 'rval': [4, 5]}) In [84]: left Out[84]: key lval 0 foo 1 1 bar 2 In [85]: right Out[85]: key rval 0 foo 4 1 bar 5 In [86]: pd.merge(left, right, on='key') Out[86]:0 码力 | 3081 页 | 10.24 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.3.3tutorials. To the getting started guides User guide The user guide provides in-depth information on the key concepts of pandas with useful background information and explanation. To the user guide API reference the methods work and which parameters can be used. It assumes that you have an understanding of the key concepts. To the reference guide Developer guide Saw a typo in the documentation? Want to improve dictionaries, the selection of a single column is very similar to selection of dictionary values based on the key. You can create a Series from scratch as well: In [5]: ages = pd.Series([22, 35, 58], name="Age")0 码力 | 3603 页 | 14.65 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.3.4tutorials. To the getting started guides User guide The user guide provides in-depth information on the key concepts of pandas with useful background information and explanation. To the user guide API reference the methods work and which parameters can be used. It assumes that you have an understanding of the key concepts. To the reference guide Developer guide Saw a typo in the documentation? Want to improve dictionaries, the selection of a single column is very similar to selection of dictionary values based on the key. You can create a Series from scratch as well: In [5]: ages = pd.Series([22, 35, 58], name="Age")0 码力 | 3605 页 | 14.68 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.25.1dtypes are preserved during groupby Previously, columns that were categorical, but not the groupby key(s) would be converted to object dtype during groupby operations. Pandas now will preserve these dtypes Column order is preserved when passing a list of dicts to DataFrame Starting with Python 3.7 the key-order of dict is guaranteed. In practice, this has been true since Python 3.6. The DataFrame constructor must be explicitly passed in order to be preserved. (GH26336) • Index.contains() is deprecated. Use key in index (__contains__) instead (GH17753). • DataFrame.get_dtype_counts() is deprecated. (GH18262)0 码力 | 2833 页 | 9.65 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.25.0dtypes are preserved during groupby Previously, columns that were categorical, but not the groupby key(s) would be converted to object dtype during groupby operations. Pandas now will preserve these dtypes Column order is preserved when passing a list of dicts to DataFrame Starting with Python 3.7 the key-order of dict is guaranteed. In practice, this has been true since Python 3.6. The DataFrame constructor must be explicitly passed in order to be preserved. (GH26336) • Index.contains() is deprecated. Use key in index (__contains__) instead (GH17753). • DataFrame.get_dtype_counts() is deprecated. (GH18262)0 码力 | 2827 页 | 9.62 MB | 1 年前3
共 32 条
- 1
- 2
- 3
- 4













