I\'m trying to see if I can remove the trailing zeros from this phone number column.
Example:
0 1 8.00735e+09 2 4.35789e+09 3 6.10644e
use astype(np.int64)
astype(np.int64)
s = pd.Series(['', 8.00735e+09, 4.35789e+09, 6.10644e+09]) mask = pd.to_numeric(s).notnull() s.loc[mask] = s.loc[mask].astype(np.int64) s 0 1 8007350000 2 4357890000 3 6106440000 dtype: object