(self, **kwargs)
return self.map_partitions(_assign, self, *kvs)
Assign new columns to this dataframe

        Alternatively use setitem syntax

        Examples
        --------
        >>> sdf = sdf.assign(z=sdf.x + sdf.y)  # doctest: +SKIP
        >>> sdf['z'] = sdf.x + sdf.y  # doctest: +SKIP
Assign new columns to this dataframe
Assign new columns to this dataframe
def assign(self, **kwargs):
        """ Assign new columns to this dataframe

        Alternatively use setitem syntax

        Examples
        --------
        >>> sdf = sdf.assign(z=sdf.x + sdf.y)  # doctest: +SKIP
        >>> sdf['z'] = sdf.x + sdf.y  # doctest: +SKIP
        """
        kvs = list(toolz.concat(kwargs.items()))

        def _assign(df, *kvs):
            keys = kvs[::2]
            values = kvs[1::2]
            kwargs = OrderedDict(zip(keys, values))
            return df.assign(**kwargs)

        return self.map_partitions(_assign, self, *kvs)
def assign ( self , * * kwargs ) : kvs = list ( toolz . concat ( kwargs . items ( ) ) ) def _assign ( df , * kvs ) : keys = kvs [ : : 2 ] values = kvs [ 1 : : 2 ] kwargs = OrderedDict ( zip ( keys , values ) ) return df . assign ( * * kwargs ) return self . map_partitions ( _assign , self , * kvs )