@@ -39,6 +39,39 @@ class ExtensionArray:
39
39
40
40
.. versionadded:: 0.23.0
41
41
42
+ Attributes
43
+ ----------
44
+ dtype
45
+ nbytes
46
+ ndim
47
+ shape
48
+
49
+ Methods
50
+ -------
51
+ argsort
52
+ astype
53
+ copy
54
+ dropna
55
+ factorize
56
+ fillna
57
+ isna
58
+ ravel
59
+ repeat
60
+ searchsorted
61
+ shift
62
+ take
63
+ unique
64
+ _concat_same_type
65
+ _formatter
66
+ _formatting_values
67
+ _from_factorized
68
+ _from_sequence
69
+ _from_sequence_of_strings
70
+ _ndarray_values
71
+ _reduce
72
+ _values_for_argsort
73
+ _values_for_factorize
74
+
42
75
Notes
43
76
-----
44
77
The interface includes the following abstract methods that must be
@@ -170,7 +203,6 @@ def _from_sequence_of_strings(cls, strings, dtype=None, copy=False):
170
203
Returns
171
204
-------
172
205
ExtensionArray
173
-
174
206
"""
175
207
raise AbstractMethodError (cls )
176
208
@@ -188,7 +220,7 @@ def _from_factorized(cls, values, original):
188
220
189
221
See Also
190
222
--------
191
- pandas. factorize
223
+ factorize
192
224
ExtensionArray.factorize
193
225
"""
194
226
raise AbstractMethodError (cls )
@@ -654,7 +686,7 @@ def factorize(self, na_sentinel: int = -1) -> Tuple[np.ndarray, ABCExtensionArra
654
686
655
687
See Also
656
688
--------
657
- pandas. factorize : Top-level factorize method that dispatches here.
689
+ factorize : Top-level factorize method that dispatches here.
658
690
659
691
Notes
660
692
-----
@@ -778,18 +810,18 @@ def take(
778
810
When `indices` contains negative values other than ``-1``
779
811
and `allow_fill` is True.
780
812
813
+ See Also
814
+ --------
815
+ numpy.take
816
+ api.extensions.take
817
+
781
818
Notes
782
819
-----
783
820
ExtensionArray.take is called by ``Series.__getitem__``, ``.loc``,
784
821
``iloc``, when `indices` is a sequence of values. Additionally,
785
822
it's called by :meth:`Series.reindex`, or any other method
786
823
that causes realignment, with a `fill_value`.
787
824
788
- See Also
789
- --------
790
- numpy.take
791
- pandas.api.extensions.take
792
-
793
825
Examples
794
826
--------
795
827
Here's an example implementation, which relies on casting the
@@ -862,7 +894,7 @@ def _formatter(self, boxed: bool = False) -> Callable[[Any], Optional[str]]:
862
894
863
895
Parameters
864
896
----------
865
- boxed: bool, default False
897
+ boxed : bool, default False
866
898
An indicated for whether or not your array is being printed
867
899
within a Series, DataFrame, or Index (True), or just by
868
900
itself (False). This may be useful if you want scalar values
@@ -889,6 +921,10 @@ def _formatting_values(self) -> np.ndarray:
889
921
.. deprecated:: 0.24.0
890
922
891
923
Use :meth:`ExtensionArray._formatter` instead.
924
+
925
+ Returns
926
+ -------
927
+ array : ndarray
892
928
"""
893
929
return np .array (self )
894
930
@@ -904,6 +940,10 @@ def ravel(self, order="C") -> ABCExtensionArray:
904
940
----------
905
941
order : {None, 'C', 'F', 'A', 'K'}, default 'C'
906
942
943
+ Returns
944
+ -------
945
+ ExtensionArray
946
+
907
947
Notes
908
948
-----
909
949
- Because ExtensionArrays are 1D-only, this is a no-op.
@@ -944,6 +984,10 @@ def _ndarray_values(self) -> np.ndarray:
944
984
945
985
The expectation is that this is cheap to compute, and is primarily
946
986
used for interacting with our indexers.
987
+
988
+ Returns
989
+ -------
990
+ array : ndarray
947
991
"""
948
992
return np .array (self )
949
993
0 commit comments