Fill in missing values in table with NaNs

3 ビュー (過去 30 日間)
BA
BA 2022 年 7 月 6 日
回答済み: Image Analyst 2022 年 7 月 6 日
I have a really large table and there are lots of empty cells in the data table that were replaced with ' " '
I want to change these values to 'NaN' instead of how they are currently being replaced. Hoping to find a way to code this into a script so people in the future don't have to when they use my data.
  1 件のコメント
Chunru
Chunru 2022 年 7 月 6 日
Attach some sample data.

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2022 年 7 月 6 日
If it currently shows as an empty string, then it can't be a nan. Nans are only for numeric variables, not string variables. Why can't you just leave them as they are? You can always skip processing those rows if you want. Why do you think you need to convert them to nans?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
If it's bigger than 5 MB, just attach the first few hundred rows instead of the whole table.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by