Changing data in excel from NA to a previous number in the column?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Omar Bayomie
am 12 Jul. 2020
Beantwortet: Chaitanya Mallela
am 16 Jul. 2020
I would like to change NA values for tempreature sensors with a previous number in the same column, to make the values consistent. The columns are more than 10000 rows (cells) of reported data, that's why it has to be automated?
0 Kommentare
Akzeptierte Antwort
Chaitanya Mallela
am 16 Jul. 2020
T = readtable('filename.csv'); % read the file as table
T = fillmissing(T,'previous'); % fill NaNs with previous values
[r,c] = find(isnan(T{:,:})); % check remaining NaN present as a first value in the columns
if(~(isempty(r) && isempty(c)))
T(r,c) = {0}; % fIll with zeros
end
writetable(T,'filename.csv'); % write the table to file
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!