@@ -36,6 +36,7 @@ class ExtensionArray(object):
3636 * isna
3737 * take
3838 * copy
39+ * append
3940 * _concat_same_type
4041
4142 An additional method is available to satisfy pandas' internal,
@@ -49,6 +50,7 @@ class ExtensionArray(object):
4950 methods:
5051
5152 * fillna
53+ * dropna
5254 * unique
5355 * factorize / _values_for_factorize
5456 * argsort / _values_for_argsort
@@ -82,14 +84,16 @@ class ExtensionArray(object):
8284 # Constructors
8385 # ------------------------------------------------------------------------
8486 @classmethod
85- def _from_sequence (cls , scalars ):
87+ def _from_sequence (cls , scalars , copy = False ):
8688 """Construct a new ExtensionArray from a sequence of scalars.
8789
8890 Parameters
8991 ----------
9092 scalars : Sequence
9193 Each element will be an instance of the scalar type for this
9294 array, ``cls.dtype.type``.
95+ copy : boolean, default True
96+ if True, copy the underlying data
9397 Returns
9498 -------
9599 ExtensionArray
@@ -379,6 +383,16 @@ def fillna(self, value=None, method=None, limit=None):
379383 new_values = self .copy ()
380384 return new_values
381385
386+ def dropna (self ):
387+ """ Return ExtensionArray without NA values
388+
389+ Returns
390+ -------
391+ valid : ExtensionArray
392+ """
393+
394+ return self [~ self .isna ()]
395+
382396 def unique (self ):
383397 """Compute the ExtensionArray of unique values.
384398
@@ -567,6 +581,34 @@ def copy(self, deep=False):
567581 """
568582 raise AbstractMethodError (self )
569583
584+ def append (self , other ):
585+ """
586+ Append a collection of Arrays together
587+
588+ Parameters
589+ ----------
590+ other : ExtenionArray or list/tuple of ExtenionArrays
591+
592+ Returns
593+ -------
594+ appended : ExtensionArray
595+ """
596+
597+ to_concat = [self ]
598+ cls = self .__class__
599+
600+ if isinstance (other , (list , tuple )):
601+ to_concat = to_concat + list (other )
602+ else :
603+ to_concat .append (other )
604+
605+ for obj in to_concat :
606+ if not isinstance (obj , cls ):
607+ raise TypeError ('all inputs must be of type {}' .format (
608+ cls .__name__ ))
609+
610+ return cls ._concat_same_type (to_concat )
611+
570612 # ------------------------------------------------------------------------
571613 # Block-related methods
572614 # ------------------------------------------------------------------------
0 commit comments