You are very close.
You applied the round to the series of values given by df.value1.
The return type is thus a Series.
You need to assign that series back to the dataframe (or another dataframe with the same Index).
Also, there is a pandas.Series.round method which is basically a short hand for pandas.Series.apply(np.round).
>>> df.value1 = df.value1.round()
>>> print df
item value1 value2
0 a 1 1.3
1 a 2 2.5
2 a 0 0.0
3 b 3 -1.0
4 b 5 -1.0
Answer from Frames Catherine White on Stack OverflowVideos
You are very close.
You applied the round to the series of values given by df.value1.
The return type is thus a Series.
You need to assign that series back to the dataframe (or another dataframe with the same Index).
Also, there is a pandas.Series.round method which is basically a short hand for pandas.Series.apply(np.round).
>>> df.value1 = df.value1.round()
>>> print df
item value1 value2
0 a 1 1.3
1 a 2 2.5
2 a 0 0.0
3 b 3 -1.0
4 b 5 -1.0
.round() is a pandas method and it applies to the output format rather than the underlying value. If you have floats with many decimal places you can instead apply the Python function round() to the column.
decimals = 2
df['column'] = df['column'].apply(lambda x: round(x, decimals))