Building datastore on dataset with missing values

5 Ansichten (letzte 30 Tage)
Mohsen Vahidzadeh
Mohsen Vahidzadeh am 29 Mär. 2018
Beantwortet: Jayanti am 18 Mär. 2025
When I use readtable on my dataset that has NAN values, the readtable command converts the missing values to numeric NANs. So that works fine, but when I build a datastore on my dataset to use tall arrays, then I get the error from MATLAB that the missing values are not numerics. How can I fix that?
Thanks

Antworten (1)

Jayanti
Jayanti am 18 Mär. 2025
Hi Mohsen,
When creating a datastore, you can handle missing values by using the "TreatAsMissing" and "MissingValue" name-value arguments. To replace every instance of "NA" with a 0 in the imported data specify the value of "TreatAsMissing" as "NA" and the value of "MissingValue" as 0.
The following line of code demonstrates this:
ds = datastore("airlinesmall.csv","TreatAsMissing","NA",...
"MissingValue",0);
You can also refer the following documentation link:

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by