Hello,
I'm trying to evaluate a datastore of CSV data that I saved with Matlab using writetable. One column contains datetimes and an example of the files' contents is this:
29-Jul-1983 00:00:00,BHP AT EQUITY,MOV_AVG_50D,0.897931-Aug-1983 00:00:00,BHP AT EQUITY,MOV_AVG_50D,0.902930-Sep-1983 00:00:00,BHP AT EQUITY,MOV_AVG_50D,0.910631-Oct-1983 00:00:00,BHP AT EQUITY,MOV_AVG_50D,0.915430-Nov-1983 00:00:00,BHP AT EQUITY,MOV_AVG_50D,0.922730-Dec-1983 00:00:00,BHP AT EQUITY,MOV_AVG_50D,0.9311
I tried the following code and received the subsequent error in the postscript. When I use datastore with "DatetimeType" set to "text," it works, but that is obviously inefficient. Can someone enlighten me on how to get this to work?
Thank You,
Michael
This code works
ds = datastore('tall.csv','DatetimeType','text');tds = tall(ds);u = unique(tds.FIELD);U = gather(u);
This code fails
ds = datastore('tall.csv');tds = tall(ds);u = unique(tds.FIELD);U = gather(u);
The error is
Evaluating tall expression using the Parallel Pool 'local':- Pass 1 of 1: 0% complete
Evaluation 0% completeError using matlab.io.datastore.TabularTextDatastore/readData (line 77)Unable to read the DATETIME data using the locale setting for your system: 'en_US'If the data contains month or day names in a language foreign to this locale, use the 'DateLocale' parameter to specify the correct locale.Learn more about errors encountered during GATHER.Error in matlab.io.datastore.TabularDatastore/read (line 120) [t, info] = readData(ds);Error in tall/gather (line 50)[varargout{:}, readFailureSummary] = iGather(varargin{:});
Best Answer