You can use the round() function of Pandas DataFrame to round all elements. You need to pass the number of decimal places as an argument.
Here is an example:
>>> import pandas as pd>>> import numpy as np>>> df = pd.DataFrame({'A':np.random.random(5), 'B':np.random.random(5)})>>> df A B0 0.592639 0.3873781 0.308161 0.2597312 0.896155 0.9634133 0.010093 0.7767404 0.633199 0.402313>>> df.round(decimals=2) A B0 0.59 0.391 0.31 0.262 0.90 0.963 0.01 0.784 0.63 0.40>>> df.round(decimals=3) A B0 0.593 0.3871 0.308 0.2602 0.896 0.9633 0.010 0.7774 0.633 0.402