how to remove a row that contains inf from a table
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
https://www.mathworks.com/help/matlab/ref/rmmissing.html does not remove inf (I think they should put options to include inf).
https://www.mathworks.com/matlabcentral/answers/369480-delete-row-in-matrix-if-the-row-contain-inf-value does not work for tables.
Then what should one do?
0 commentaires
Réponse acceptée
Adam Danz
le 8 Juil 2020
inf values are definitly not missing-value indicators. They are no different than the value 7 or pi.
The solution in the 2nd link you provided is designed for matrices. It needs to be adapted to tables.
If your table only contains numeric scalars, you could convert the table to an array (matrix), apply that solution, and then convert back to a table.
If you want to apply that solution to specific columns of a table that contain numeric scalars, you can do so using
T.col(isinf(T.col)) = NaN;
where T is your table and col is the column name.
Note that you cannot remove numeric values from the table unless you remove the entire row. You can, however, replace their values with NaN or some other value.
If you run into any problems, show us what you've done, describe the variables, and the problem.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!