How does the logic of calculating a mean on a string column work (the result is 246.8)? Is there any specific use case for it?
import pandas as pd
import numpy as np
s = np.array(["0", "1", "2", "3", "4"])
pd.DataFrame(s).mean()
Out[1]:
0 246.8
dtype: float64
Just to be clear, I am aware that to calculate the mean of numbers, I should do something along these lines.
pd.DataFrame(s.astype(int)).mean()
Out[2]:
0 2.0
dtype: float64