@@ -38,10 +38,9 @@ class ExtensionArray(object):
3838 * copy
3939 * _concat_same_type
4040
41- Some additional methods are available to satisfy pandas' internal, private
42- block API:
41+ An additional method is available to satisfy pandas' internal,
42+ private block API.
4343
44- * _can_hold_na
4544 * _formatting_values
4645
4746 Some methods require casting the ExtensionArray to an ndarray of Python
@@ -399,7 +398,8 @@ def _values_for_factorize(self):
399398 Returns
400399 -------
401400 values : ndarray
402- An array suitable for factoraization. This should maintain order
401+
402+ An array suitable for factorization. This should maintain order
403403 and be a supported dtype (Float64, Int64, UInt64, String, Object).
404404 By default, the extension array is cast to object dtype.
405405 na_value : object
@@ -422,7 +422,7 @@ def factorize(self, na_sentinel=-1):
422422 Returns
423423 -------
424424 labels : ndarray
425- An interger NumPy array that's an indexer into the original
425+ An integer NumPy array that's an indexer into the original
426426 ExtensionArray.
427427 uniques : ExtensionArray
428428 An ExtensionArray containing the unique values of `self`.
@@ -566,16 +566,12 @@ def _concat_same_type(cls, to_concat):
566566 """
567567 raise AbstractMethodError (cls )
568568
569- @property
570- def _can_hold_na (self ):
571- # type: () -> bool
572- """Whether your array can hold missing values. True by default.
573-
574- Notes
575- -----
576- Setting this to false will optimize some operations like fillna.
577- """
578- return True
569+ # The _can_hold_na attribute is set to True so that pandas internals
570+ # will use the ExtensionDtype.na_value as the NA value in operations
571+ # such as take(), reindex(), shift(), etc. In addition, those results
572+ # will then be of the ExtensionArray subclass rather than an array
573+ # of objects
574+ _can_hold_na = True
579575
580576 @property
581577 def _ndarray_values (self ):
0 commit comments