@@ -263,10 +263,12 @@ def _register_accessor(name: str, cls):
263
263
264
264
* Must contain an init method that:
265
265
* accepts a single {klass} object
266
- * raises an {AttributeError} if the {klass} object does not have correctly matching inputs for the accessor
266
+ * raises an {AttributeError} if the {klass} object does not have correctly
267
+ matching inputs for the accessor
267
268
* Must contain a method for each access pattern.
268
269
* The methods should be able to take any argument signature.
269
- * Accessible using the @property decorator if no additional arguments are needed.
270
+ * Accessible using the @property decorator if no additional arguments are
271
+ needed.
270
272
"""
271
273
272
274
def decorator (accessor ):
@@ -288,7 +290,9 @@ def decorator(accessor):
288
290
_register_df_doc = """
289
291
Examples
290
292
--------
291
- In your library code, an accessor that only accepts integers could have a class defined like this:
293
+ In your library code, an accessor that only accepts integers could
294
+ have a class defined like this:
295
+
292
296
.. code-block:: python
293
297
294
298
import pandas as pd
@@ -310,7 +314,7 @@ def sum(self):
310
314
>>> df.int_accessor
311
315
Traceback (most recent call last):
312
316
...
313
- AttributeError: All columns must contain integer values only. Did you mean: '_accessors'?
317
+ AttributeError: All columns must contain integer values only.
314
318
>>> df = pd.DataFrame([[1, 2], [3, 4]])
315
319
>>> df.int_accessor.sum()
316
320
0 4
@@ -330,7 +334,9 @@ def register_dataframe_accessor(name: str):
330
334
_series_doc = """
331
335
Examples
332
336
--------
333
- In your library code, an accessor that only accepts integers could have a class defined like this:
337
+ In your library code, an accessor that only accepts integers could
338
+ have a class defined like this:
339
+
334
340
.. code-block:: python
335
341
336
342
import pandas as pd
@@ -352,7 +358,7 @@ def sum(self):
352
358
>>> df.int_accessor
353
359
Traceback (most recent call last):
354
360
...
355
- AttributeError: The series must contain integer data only. Did you mean: '_accessors'?
361
+ AttributeError: The series must contain integer data only.
356
362
>>> df = pd.Series([1, 2, 3])
357
363
>>> df.int_accessor.sum
358
364
6
@@ -370,7 +376,9 @@ def register_series_accessor(name: str):
370
376
_index_doc = """
371
377
Examples
372
378
--------
373
- In your library code, an accessor that only accepts integers could have a class defined like this:
379
+ In your library code, an accessor that only accepts integers could
380
+ have a class defined like this:
381
+
374
382
.. code-block:: python
375
383
376
384
import pandas as pd
@@ -394,7 +402,7 @@ def even(self):
394
402
>>> df.index.int_accessor
395
403
Traceback (most recent call last):
396
404
...
397
- AttributeError: The index must only be an integer value. Did you mean: '_accessors'?
405
+ AttributeError: The index must only be an integer value.
398
406
>>> df = pd.DataFrame({
399
407
'col1': [1, 2, 3, 4],
400
408
'col2': ['a', 'b', 'c', 'd']
0 commit comments