Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13891

TypeError: data type ' int64' not understood

$
0
0

I have the following function to load data in my jupyter notebook

#function to load datadef load_dataset(x_path, y_path):    x = pd.read_csv(os.sep.join([DATA_DIR, x_path]),                    dtype=DTYPES,                    index_col="ID")    y = pd.read_csv(os.sep.join([DATA_DIR, y_path]))    return x, y

and the data has the below types defined

DTYPES = {'ID':'int64','columnA':'str','columnB':'float32','columnC':'float64','columnD':'datetime64[ns]'}

The header of the above csv is as below

ID          columnA   columnB   columnC         columnD941215   SALE      15000       56           10/1/2018

when I call the method in my notebook

from model import load_datasetX_train, y_train = load_dataset("X_train.zip", "y_train.zip")

I get the below error

2055 raise TypeError("data type '{}' not understood".format(dtype))2057     # Any invalid dtype (such as pd.Timestamp) should raise an error.TypeError: data type ' int64' not understood

Viewing all articles
Browse latest Browse all 13891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>