 pandas: powerful Python data analysis toolkit - 0.24.0DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. In [242]: df.rename({'one': 'foo', 'two': 'bar'}, axis='columns') previous page groupby([by, axis, level, as_index, sort, ...]) Group DataFrame or Series using a mapper or by a Series of columns. gt(other[, level, fill_value, axis]) Greater than of series and other matching indices as other ob- ject. rename([index]) Alter Series index labels or name. rename_axis([mapper, index, columns, axis, . . . ]) Set the name of the axis for the index or columns. reorder_levels(order)0 码力 | 2973 页 | 9.90 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 0.24.0DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. In [242]: df.rename({'one': 'foo', 'two': 'bar'}, axis='columns') previous page groupby([by, axis, level, as_index, sort, ...]) Group DataFrame or Series using a mapper or by a Series of columns. gt(other[, level, fill_value, axis]) Greater than of series and other matching indices as other ob- ject. rename([index]) Alter Series index labels or name. rename_axis([mapper, index, columns, axis, . . . ]) Set the name of the axis for the index or columns. reorder_levels(order)0 码力 | 2973 页 | 9.90 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.0.0variables (GH23573, GH30959) • Series.map() now accepts collections.abc.Mapping subclasses as a mapper (GH29733) • Added an experimental attrs for storing global metadata about a dataset (GH29062) • 1 >>> df.rename(mapper={0: 1}, index={0: 2}) 0 2 1 pandas 1.0.0 >>> df.rename({0: 1}, index={0: 2}) Traceback (most recent call last): ... TypeError: Cannot specify both 'mapper' and any of 'index' 'index' or 'columns' >>> df.rename(mapper={0: 1}, index={0: 2}) Traceback (most recent call last): ... TypeError: Cannot specify both 'mapper' and any of 'index' or 'columns' You can still change the axis0 码力 | 3015 页 | 10.78 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 1.0.0variables (GH23573, GH30959) • Series.map() now accepts collections.abc.Mapping subclasses as a mapper (GH29733) • Added an experimental attrs for storing global metadata about a dataset (GH29062) • 1 >>> df.rename(mapper={0: 1}, index={0: 2}) 0 2 1 pandas 1.0.0 >>> df.rename({0: 1}, index={0: 2}) Traceback (most recent call last): ... TypeError: Cannot specify both 'mapper' and any of 'index' 'index' or 'columns' >>> df.rename(mapper={0: 1}, index={0: 2}) Traceback (most recent call last): ... TypeError: Cannot specify both 'mapper' and any of 'index' or 'columns' You can still change the axis0 码力 | 3015 页 | 10.78 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 0.19.0sparseness conversions); is a view groupby([by, axis, level, as_index, sort, ...]) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of matching indices to myself. rename([index]) Alter axes input function or functions. rename_axis(mapper[, axis, copy, inplace]) Alter index and / or columns using input function or functions. reorder_levels(order) level=None, as_index=True, sort=True, group_keys=True, squeeze=False, **kwargs) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of0 码力 | 1937 页 | 12.03 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 0.19.0sparseness conversions); is a view groupby([by, axis, level, as_index, sort, ...]) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of matching indices to myself. rename([index]) Alter axes input function or functions. rename_axis(mapper[, axis, copy, inplace]) Alter index and / or columns using input function or functions. reorder_levels(order) level=None, as_index=True, sort=True, group_keys=True, squeeze=False, **kwargs) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of0 码力 | 1937 页 | 12.03 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 0.19.1sparseness conversions); is a view groupby([by, axis, level, as_index, sort, ...]) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of matching indices to myself. rename([index]) Alter axes input function or functions. rename_axis(mapper[, axis, copy, inplace]) Alter index and / or columns using input function or functions. reorder_levels(order) level=None, as_index=True, sort=True, group_keys=True, squeeze=False, **kwargs) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of0 码力 | 1943 页 | 12.06 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 0.19.1sparseness conversions); is a view groupby([by, axis, level, as_index, sort, ...]) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of matching indices to myself. rename([index]) Alter axes input function or functions. rename_axis(mapper[, axis, copy, inplace]) Alter index and / or columns using input function or functions. reorder_levels(order) level=None, as_index=True, sort=True, group_keys=True, squeeze=False, **kwargs) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of0 码力 | 1943 页 | 12.06 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.2.3DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. 200 Chapter 2. User Guide pandas: powerful Python data analysis 314 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors) (continues on next page) 2.11. Duplicate 4439 4 3 6 4440 """ -> 4441 return super().rename( 4442 mapper=mapper, 4443 index=index, /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors)0 码力 | 3323 页 | 12.74 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 1.2.3DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. 200 Chapter 2. User Guide pandas: powerful Python data analysis 314 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors) (continues on next page) 2.11. Duplicate 4439 4 3 6 4440 """ -> 4441 return super().rename( 4442 mapper=mapper, 4443 index=index, /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors)0 码力 | 3323 页 | 12.74 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.3.2DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. 232 Chapter 2. User Guide pandas: powerful Python data analysis 326 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors) (continues on next page) 2.11. Duplicate 5032 4 3 6 5033 """ -> 5034 return super().rename( 5035 mapper=mapper, 5036 index=index, /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors)0 码力 | 3509 页 | 14.01 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 1.3.2DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. 232 Chapter 2. User Guide pandas: powerful Python data analysis 326 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors) (continues on next page) 2.11. Duplicate 5032 4 3 6 5033 """ -> 5034 return super().rename( 5035 mapper=mapper, 5036 index=index, /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors)0 码力 | 3509 页 | 14.01 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.3.3DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. In [247]: df.rename({"one": "foo", "two": "bar"}, axis="columns") /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, inplace, ˓→ level, errors) 5037 4 3 6 5038 """ -> 5039 return super().rename( 5040 mapper=mapper, 5041 index=index, /pandas/pandas/core/generic /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy,␣ ˓→inplace, level, errors) 1162 return None 1163 else: -> 1164 return result.__finalize__(self, method="rename") 1165 11660 码力 | 3603 页 | 14.65 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 1.3.3DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. In [247]: df.rename({"one": "foo", "two": "bar"}, axis="columns") /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, inplace, ˓→ level, errors) 5037 4 3 6 5038 """ -> 5039 return super().rename( 5040 mapper=mapper, 5041 index=index, /pandas/pandas/core/generic /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy,␣ ˓→inplace, level, errors) 1162 return None 1163 else: -> 1164 return result.__finalize__(self, method="rename") 1165 11660 码力 | 3603 页 | 14.65 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.3.4DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. In [247]: df.rename({"one": "foo", "two": "bar"}, axis="columns") /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, inplace, ˓→ level, errors) 5037 4 3 6 5038 """ -> 5039 return super().rename( 5040 mapper=mapper, 5041 index=index, /pandas/pandas/core/generic /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy,␣ ˓→inplace, level, errors) 1162 return None 1163 else: -> 1164 return result.__finalize__(self, method="rename") 1165 11660 码力 | 3605 页 | 14.68 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 1.3.4DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. In [247]: df.rename({"one": "foo", "two": "bar"}, axis="columns") /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, inplace, ˓→ level, errors) 5037 4 3 6 5038 """ -> 5039 return super().rename( 5040 mapper=mapper, 5041 index=index, /pandas/pandas/core/generic /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy,␣ ˓→inplace, level, errors) 1162 return None 1163 else: -> 1164 return result.__finalize__(self, method="rename") 1165 11660 码力 | 3605 页 | 14.68 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.2.0DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. 200 Chapter 2. User Guide pandas: powerful Python data analysis 314 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors) (continues on next page) 2.11. Duplicate 4436 4 3 6 4437 """ -> 4438 return super().rename( 4439 mapper=mapper, 4440 index=index, /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors)0 码力 | 3313 页 | 10.91 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 1.2.0DataFrame.rename() also supports an “axis-style” calling convention, where you specify a single mapper and the axis to apply that mapping to. 200 Chapter 2. User Guide pandas: powerful Python data analysis 314 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD /pandas/pandas/core/frame.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors) (continues on next page) 2.11. Duplicate 4436 4 3 6 4437 """ -> 4438 return super().rename( 4439 mapper=mapper, 4440 index=index, /pandas/pandas/core/generic.py in rename(self, mapper, index, columns, axis, copy, ˓→inplace, level, errors)0 码力 | 3313 页 | 10.91 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 0.7.1correspondence (which can be Series.groupby([by, axis, level, as_index, sort]) Group series using mapper (dict or key function, apply given function pandas.Series.apply Series.apply(func) Invoke function groupby Series.groupby(by=None, axis=0, level=None, as_index=True, sort=True) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of reindex_like(other[, method]) Reindex Series to match index of another Series, optionally with Series.rename(mapper) Alter Series index using dict or function Series.select(crit[, axis]) Return data corresponding0 码力 | 281 页 | 1.45 MB | 1 年前3 pandas: powerful Python data analysis toolkit - 0.7.1correspondence (which can be Series.groupby([by, axis, level, as_index, sort]) Group series using mapper (dict or key function, apply given function pandas.Series.apply Series.apply(func) Invoke function groupby Series.groupby(by=None, axis=0, level=None, as_index=True, sort=True) Group series using mapper (dict or key function, apply given function to group, return result as series) or by a series of reindex_like(other[, method]) Reindex Series to match index of another Series, optionally with Series.rename(mapper) Alter Series index using dict or function Series.select(crit[, axis]) Return data corresponding0 码力 | 281 页 | 1.45 MB | 1 年前3
共 32 条
- 1
- 2
- 3
- 4













