Skip to content

Commit 37fcce8

Browse files
committed
Revert "Fixed Issue pandas-dev#42447"
This reverts commit f69e0c3.
1 parent 7763639 commit 37fcce8

File tree

4 files changed

+14
-24
lines changed

4 files changed

+14
-24
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
structures designed to make working with "relational" or "labeled" data both
2525
easy and intuitive. It aims to be the fundamental high-level building block for
2626
doing practical, **real world** data analysis in Python. Additionally, it has
27-
the broader goal of becoming **the most powerful and flexible open-source data
28-
analysis/manipulation tool available in any language**. It is already well on
27+
the broader goal of becoming **the most powerful and flexible open source data
28+
analysis / manipulation tool available in any language**. It is already well on
2929
its way towards this goal.
3030

3131
## Main Features
@@ -107,14 +107,14 @@ pip install pandas
107107
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies.
108108

109109
## Installation from sources
110-
To install pandas the from source you need [Cython](https://cython.org/) in addition to the normal
110+
To install pandas from source you need [Cython](https://cython.org/) in addition to the normal
111111
dependencies above. Cython can be installed from PyPI:
112112

113113
```sh
114114
pip install cython
115115
```
116116

117-
In the `pandas` directory (the same one where you found this file after
117+
In the `pandas` directory (same one where you found this file after
118118
cloning the git repo), execute:
119119

120120
```sh
@@ -160,14 +160,14 @@ Most development discussions take place on GitHub in this repo. Further, the [pa
160160

161161
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
162162

163-
A detailed overview of how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
163+
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
164164

165-
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are several issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start.
165+
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
166166

167-
You can also triage issues which may include reproducing bug reports or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to pandas on CodeTriage](https://www.codetriage.com/pandas-dev/pandas).
167+
You can also triage issues which may include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to pandas on CodeTriage](https://www.codetriage.com/pandas-dev/pandas).
168168

169169
Or maybe through using pandas you have an idea of your own or are looking for something in the documentation and thinking ‘this can be improved’...you can do something about it!
170170

171-
Feel free to ask questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or [Gitter](https://gitter.im/pydata/pandas).
171+
Feel free to ask questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas).
172172

173173
As contributors and maintainers to this project, you are expected to abide by pandas' code of conduct. More information can be found at: [Contributor Code of Conduct](https://github.com/pandas-dev/pandas/blob/master/.github/CODE_OF_CONDUCT.md)

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4418,7 +4418,7 @@ def add_prefix(self: NDFrameT, prefix: str) -> NDFrameT:
44184418
# expected "NDFrameT")
44194419
# error: Argument 1 to "rename" of "NDFrame" has incompatible type
44204420
# "**Dict[str, partial[str]]"; expected "Union[str, int, None]"
4421-
return self.rename(**mapper) # type: ignore[return-value, arg-type]
4421+
return self.rename(**mapper)
44224422

44234423
@final
44244424
def add_suffix(self: NDFrameT, suffix: str) -> NDFrameT:
@@ -4482,7 +4482,7 @@ def add_suffix(self: NDFrameT, suffix: str) -> NDFrameT:
44824482
# expected "NDFrameT")
44834483
# error: Argument 1 to "rename" of "NDFrame" has incompatible type
44844484
# "**Dict[str, partial[str]]"; expected "Union[str, int, None]"
4485-
return self.rename(**mapper) # type: ignore[return-value, arg-type]
4485+
return self.rename(**mapper)
44864486

44874487
def sort_values(
44884488
self,

pandas/core/series.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -4491,7 +4491,7 @@ def rename(
44914491
----------
44924492
axis : {0 or "index"}
44934493
Unused. Accepted for compatibility with DataFrame method only.
4494-
mapper : scalar, hashable sequence, dict-like or function, optional
4494+
index : scalar, hashable sequence, dict-like or function, optional
44954495
Functions or dict-like are transformations to apply to
44964496
the index.
44974497
Scalar or hashable sequence-like will alter the ``Series.name``
@@ -4539,16 +4539,12 @@ def rename(
45394539
# Make sure we raise if an invalid 'axis' is passed.
45404540
axis = self._get_axis_number(axis)
45414541

4542-
if index is not None and mapper is not None:
4543-
raise TypeError("Cannot specify both 'mapper' and 'index'")
4544-
if mapper is None:
4545-
mapper = index
4546-
if callable(mapper) or is_dict_like(mapper):
4542+
if callable(index) or is_dict_like(index):
45474543
return super()._rename(
4548-
mapper, copy=copy, inplace=inplace, level=level, errors=errors
4544+
index, copy=copy, inplace=inplace, level=level, errors=errors
45494545
)
45504546
else:
4551-
return self._set_name(mapper, inplace=inplace)
4547+
return self._set_name(index, inplace=inplace)
45524548

45534549
@overload
45544550
def set_axis(

pandas/tests/series/methods/test_rename.py

-6
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ def test_rename_callable(self):
105105

106106
assert result.name == expected.name
107107

108-
def test_rename_method_and_index(self):
109-
# GH 40977
110-
ser = Series([1, 2])
111-
with pytest.raises(TypeError, match="Cannot specify both 'mapper' and 'index'"):
112-
ser.rename(str, index=str)
113-
114108
def test_rename_none(self):
115109
# GH 40977
116110
ser = Series([1, 2], name="foo")

0 commit comments

Comments
 (0)