#NEWLINE# def stack( self , **dimensions ) : #NEWLINE# #INDENT# '\n        Stack any number of existing dimensions into a single new dimension.\n\n        New dimensions will be added at the end, and the order of the data\n        along each new dimension will be in contiguous (C) order.\n\n        Parameters\n        ----------\n        **dimensions : keyword arguments of the form new_name=(dim1, dim2, ...)\n            Names of new dimensions, and the existing dimensions that they\n            replace.\n\n        Returns\n        -------\n        stacked : Variable\n            Variable with the same attributes but stacked data.\n\n        See also\n        --------\n        Variable.unstack\n        ' #NEWLINE# result = self #NEWLINE# for ( new_dim , dims ) in dimensions . items ( ) : #NEWLINE# #INDENT# result = result . _stack_once ( dims , new_dim ) #NEWLINE# #UNINDENT# return dimensions