In what way do these attempts not work? What result are you seeing, and what result would you like to have instead?
Perhaps more importantly, why do you want to round these values? Rounding causes loss of data, and is typically only done as a final step when presenting data, not during data processing.
@abessman
Thanks for your quick reply.
for example if I have 15.123456789, I’d like it to be just 15.1. The reason why I want to round these value is because I wanna put them as labels above the bars in a bar plot.
Still not really clear to me what result you want or what you are starting with.
Is train a DataFrame? I assume so since it has loc.
Why use groupy("meter")? It just sorts the columns by the values in the meter column, but the sorting is lost when you take the mean.
Do you want to calculate the means of the two columns meter and meter_reading and round each value to two decimals? If my assumptions above are correct, that can be done like this: