We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d385f6e commit 3775699Copy full SHA for 3775699
pandas/core/window/rolling.py
@@ -211,14 +211,13 @@ def __repr__(self) -> str:
211
Provide a nice str repr of our rolling object.
212
"""
213
214
- attrs = (
215
- "{k}={v}".format(k=k, v=getattr(self, k))
216
- for k in self._attributes
217
- if getattr(self, k, None) is not None
218
- )
219
- return "{klass} [{attrs}]".format(
220
- klass=self._window_type, attrs=",".join(attrs)
+ attrs_list = (
+ f"{attr_name}={getattr(self, attr_name)}"
+ for attr_name in self._attributes
+ if getattr(self, attr_name, None) is not None
221
)
+ attrs = ",".join(attrs_list)
+ return "{klass} [{attrs}]".format(klass=self._window_type, attrs=attrs)
222
223
def __iter__(self):
224
url = "https://github.com/pandas-dev/pandas/issues/11704"
0 commit comments