modin/pandas/series.py
def append(
        self, to_append, ignore_index=False, verify_integrity=False
    ):  # noqa: PR01, RT01, D200
        """
        Concatenate two or more Series.
        """
        from .dataframe import DataFrame

        bad_type_msg = (
            'cannot concatenate object of type "{}"; only pd.Series, '
            "pd.DataFrame, and pd.Panel (deprecated) objs are valid"
        )
        if isinstance(to_append, list):
            if not all(isinstance(o, BasePandasDataset) for o in to_append):
                raise TypeError(
                    bad_type_msg.format(
                        type(
                            next(
                                o
                                for o in to_append
                                if not isinstance(o, BasePandasDataset)
                            )
                        )
                    )
                )
            elif all(isinstance(o, Series) for o in to_append):
                self.name = None
                for i in range(len(to_append)):
                    to_append[i].name = None
                    to_append[i] = to_append[i]._query_compiler
            else:
                # Matching pandas behavior of naming the Series columns 0
                self.name = 0
                for i in range(len(to_append)):
                    if isinstance(to_append[i], Series):
                        to_append[i].name = 0
                        to_append[i] = DataFrame(to_append[i])
                return DataFrame(self.copy()).append(
                    to_append,
                    ignore_index=ignore_index,
                    verify_integrity=verify_integrity,
                )
        elif isinstance(to_append, Series):
            self.name = None
            to_append.name = None
            to_append = [to_append._query_compiler]
        elif isinstance(to_append, DataFrame):
            self.name = 0
            return DataFrame(self.copy()).append(
                to_append, ignore_index=ignore_index, verify_integrity=verify_integrity
            )
        else:
            raise TypeError(bad_type_msg.format(type(to_append)))
        # If ignore_index is False, by definition the Index will be correct.
        # We also do this first to ensure that we don't waste compute/memory.
        if verify_integrity and not ignore_index:
            appended_index = (
                self.index.append(to_append.index)
                if not isinstance(to_append, list)
                else self.index.append([o.index for o in to_append])
            )
            is_valid = next((False for idx in appended_index.duplicated() if idx), True)
            if not is_valid:
                raise ValueError(
                    "Indexes have overlapping values: {}".format(
                        appended_index[appended_index.duplicated()]
                    )
                )
        query_compiler = self._query_compiler.concat(
            0, to_append, ignore_index=ignore_index, sort=None
        )
        if len(query_compiler.columns) > 1:
            return DataFrame(query_compiler=query_compiler)
        else:
            return Series(query_compiler=query_compiler)

        Concatenate two or more Series.
        
Concatenate two or more Series.
Concatenate two or more Series .
def append(
        self, to_append, ignore_index=False, verify_integrity=False
    ):  
        from .dataframe import DataFrame
        bad_type_msg = (
            'cannot concatenate object of type "{}"; only pd.Series, '
            "pd.DataFrame, and pd.Panel (deprecated) objs are valid"
        )
        if isinstance(to_append, list):
            if not all(isinstance(o, BasePandasDataset) for o in to_append):
                raise TypeError(
                    bad_type_msg.format(
                        type(
                            next(
                                o
                                for o in to_append
                                if not isinstance(o, BasePandasDataset)
                            )
                        )
                    )
                )
            elif all(isinstance(o, Series) for o in to_append):
                self.name = None
                for i in range(len(to_append)):
                    to_append[i].name = None
                    to_append[i] = to_append[i]._query_compiler
            else:
                self.name = 0
                for i in range(len(to_append)):
                    if isinstance(to_append[i], Series):
                        to_append[i].name = 0
                        to_append[i] = DataFrame(to_append[i])
                return DataFrame(self.copy()).append(
                    to_append,
                    ignore_index=ignore_index,
                    verify_integrity=verify_integrity,
                )
        elif isinstance(to_append, Series):
            self.name = None
            to_append.name = None
            to_append = [to_append._query_compiler]
        elif isinstance(to_append, DataFrame):
            self.name = 0
            return DataFrame(self.copy()).append(
                to_append, ignore_index=ignore_index, verify_integrity=verify_integrity
            )
        else:
            raise TypeError(bad_type_msg.format(type(to_append)))
        if verify_integrity and not ignore_index:
            appended_index = (
                self.index.append(to_append.index)
                if not isinstance(to_append, list)
                else self.index.append([o.index for o in to_append])
            )
            is_valid = next((False for idx in appended_index.duplicated() if idx), True)
            if not is_valid:
                raise ValueError(
                    "Indexes have overlapping values: {}".format(
                        appended_index[appended_index.duplicated()]
                    )
                )
        query_compiler = self._query_compiler.concat(
            0, to_append, ignore_index=ignore_index, sort=None
        )
        if len(query_compiler.columns) > 1:
            return DataFrame(query_compiler=query_compiler)
        else:
            return Series(query_compiler=query_compiler)
def append ( self , to_append , ignore_index = False , verify_integrity = False ) : from . dataframe import DataFrame bad_type_msg = ( 'cannot concatenate object of type "{}"; only pd.Series, ' "pd.DataFrame, and pd.Panel (deprecated) objs are valid" ) if isinstance ( to_append , list ) : if not all ( isinstance ( o , BasePandasDataset ) for o in to_append ) : raise TypeError ( bad_type_msg . format ( type ( next ( o for o in to_append if not isinstance ( o , BasePandasDataset ) ) ) ) ) elif all ( isinstance ( o , Series ) for o in to_append ) : self . name = None for i in range ( len ( to_append ) ) : to_append [ i ] . name = None to_append [ i ] = to_append [ i ] . _query_compiler else : self . name = 0 for i in range ( len ( to_append ) ) : if isinstance ( to_append [ i ] , Series ) : to_append [ i ] . name = 0 to_append [ i ] = DataFrame ( to_append [ i ] ) return DataFrame ( self . copy ( ) ) . append ( to_append , ignore_index = ignore_index , verify_integrity = verify_integrity , ) elif isinstance ( to_append , Series ) : self . name = None to_append . name = None to_append = [ to_append . _query_compiler ] elif isinstance ( to_append , DataFrame ) : self . name = 0 return DataFrame ( self . copy ( ) ) . append ( to_append , ignore_index = ignore_index , verify_integrity = verify_integrity ) else : raise TypeError ( bad_type_msg . format ( type ( to_append ) ) ) if verify_integrity and not ignore_index : appended_index = ( self . index . append ( to_append . index ) if not isinstance ( to_append , list ) else self . index . append ( [ o . index for o in to_append ] ) ) is_valid = next ( ( False for idx in appended_index . duplicated ( ) if idx ) , True ) if not is_valid : raise ValueError ( "Indexes have overlapping values: {}" . format ( appended_index [ appended_index . duplicated ( ) ] ) ) query_compiler = self . _query_compiler . concat ( 0 , to_append , ignore_index = ignore_index , sort = None ) if len ( query_compiler . columns ) > 1 : return DataFrame ( query_compiler = query_compiler ) else : return Series ( query_compiler = query_compiler )
Concatenate two or more Series.
Concatenate two or more Series .
# noqa: PR01, RT01, D200 """
        Concatenate two or more Series.
        """ # Matching pandas behavior of naming the Series columns 0 # If ignore_index is False, by definition the Index will be correct. # We also do this first to ensure that we don't waste compute/memory.
self
to_append
ignore_index
verify_integrity