To specify data types for various columns when creating a Pandas dataframe, do this:
df = pd.read_csv(filename, dtype={'col1':np.int64, 'col2':str, ...})
If converters are given, they will be used instead of data type conversion.
df = pd.read_csv(filename, dtype={'col1':np.int64, 'col2':str, ...})
If converters are given, they will be used instead of data type conversion.
No comments:
Post a Comment