def round(self, decimals=<NUM_LIT:0>, *args, **kwargs):
from pandas.core.reshape.concat import concat<EOL>def _dict_round(df, decimals):<EOL><INDENT>for col, vals in df.iteritems():<EOL><INDENT>try:<EOL><INDENT>yield _series_round(vals, decimals[col])<EOL><DEDENT>except KeyError:<EOL><INDENT>yield vals<EOL><DEDENT><DEDENT><DEDENT>def _series_round(s, decimals):<EOL><INDENT>if is_integer_dtype(s) or is_float_dtype(s):<EOL><INDENT>return s.round(decimals)<EOL><DEDENT>return s<EOL><DEDENT>nv.validate_round(args, kwargs)<EOL>if isinstance(decimals, (dict, Series)):<EOL><INDENT>if isinstance(decimals, Series):<EOL><INDENT>if not decimals.index.is_unique:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>new_cols = [col for col in _dict_round(self, decimals)]<EOL><DEDENT>elif is_integer(decimals):<EOL><INDENT>new_cols = [_series_round(v, decimals)<EOL>for _, v in self.iteritems()]<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if len(new_cols) > <NUM_LIT:0>:<EOL><INDENT>return self._constructor(concat(new_cols, axis=<NUM_LIT:1>),<EOL>index=self.index,<EOL>columns=self.columns)<EOL><DEDENT>else:<EOL><INDENT>return self<EOL><DEDENT>
Round a DataFrame to a variable number of decimal places.

Parameters
----------
decimals : int, dict, Series
    Number of decimal places to round each column to. If an int is
    given, round each column to the same number of places.
    Otherwise dict and Series round to variable numbers of places.
    Column names should be in the keys if `decimals` is a
    dict-like, or in the index if `decimals` is a Series. Any
    columns not included in `decimals` will be left as is. Elements
    of `decimals` which are not columns of the input will be
    ignored.
*args
    Additional keywords have no effect but might be accepted for
    compatibility with numpy.
**kwargs
    Additional keywords have no effect but might be accepted for
    compatibility with numpy.

Returns
-------
DataFrame
    A DataFrame with the affected columns rounded to the specified
    number of decimal places.

See Also
--------
numpy.around : Round a numpy array to the given number of decimals.
Series.round : Round a Series to the given number of decimals.

Examples
--------
>>> df = pd.DataFrame([(.21, .32), (.01, .67), (.66, .03), (.21, .18)],
...                   columns=['dogs', 'cats'])
>>> df
    dogs  cats
0  0.21  0.32
1  0.01  0.67
2  0.66  0.03
3  0.21  0.18

By providing an integer each column is rounded to the same number
of decimal places

>>> df.round(1)
    dogs  cats
0   0.2   0.3
1   0.0   0.7
2   0.7   0.0
3   0.2   0.2

With a dict, the number of places for specific columns can be
specfified with the column names as key and the number of decimal
places as value

>>> df.round({'dogs': 1, 'cats': 0})
    dogs  cats
0   0.2   0.0
1   0.0   1.0
2   0.7   0.0
3   0.2   0.0

Using a Series, the number of places for specific columns can be
specfified with the column names as index and the number of
decimal places as value

>>> decimals = pd.Series([0, 1], index=['cats', 'dogs'])
>>> df.round(decimals)
    dogs  cats
0   0.2   0.0
1   0.0   1.0
2   0.7   0.0
3   0.2   0.0