Аa
Size: a a a
Аa
AK
Аa
Аa
MK
x = pd.read_csv(path,
sep=sep,
index_col=index,
dtype=get_data_types(path, sep=sep, index=index, target=target))
def get_data_types(path, sep='\t', index=None, target=None, n_rows=100):
data = pd.read_csv(path, sep=sep, index_col=index, nrows=n_rows)
dtypes = data.dtypes.map({
np.dtype('int64'): 'int32',
np.dtype('float64'): 'float32',
np.dtype('object'): 'category'
}).to_dict()
if target:
dtypes[target] = 'object'
return dtypes
MK
MK
MK
Аa
AD
VE
SZ
TypeError: Cannot convert 'b'8859030FR'' to float
SZ
SZ
Аa
SZ
Аa
SZ
AS
Аa