1df = pd.read_csv("weather.tsv", sep="\t",
2 dtype={'Day': str,'Wind':int64})
3df.dtypes
4
1In [273]: cols = df.columns.drop('id')
2
3In [274]: df[cols] = df[cols].apply(pd.to_numeric, errors='coerce')
4
5In [275]: df
6Out[275]:
7 id a b c d e f
80 id_3 NaN 6 3 5 8 1.0
91 id_9 3.0 7 5 7 3 NaN
102 id_7 4.0 2 3 5 4 2.0
113 id_0 7.0 3 5 7 9 4.0
124 id_0 2.0 4 6 4 0 2.0
13
14In [276]: df.dtypes
15Out[276]:
16id object
17a float64
18b int64
19c int64
20d int64
21e int64
22f float64
23dtype: object
24