Counting all NaN for each variable in the table

2 ビュー (過去 30 日間)
Mouhammad Jomaa Alkaseam
Mouhammad Jomaa Alkaseam 2022 年 2 月 6 日
回答済み: Rahul 2024 年 9 月 19 日
I have wind and wave data, (9 columns), I would like to have the NaN for each column and then plot the clean data with all the indicated missing values for each column

回答 (1 件)

Rahul
Rahul 2024 年 9 月 19 日
In order to clean your data that contains NaN values, you can consider the following method:
  • You can first identify where the NaN values exist in your data using the 'isnan' function on your data.
  • Further to clean the data, you can use 'rmmissing' function which would remove the rows with NaN values from the data.
  • If the above step is not desired for your use-case, you can consider interpolating the data to fill in the missing values by using the 'fillmissing' function.
  • In the first step, 'isnan' function would give you indices where NaN values exist. You can use the 'find' function on these indices and obtain indicate the missing values and plot them using ‘plot’ function.
You can refer to the following MathWorks documentations to know more about these functions:
Hope this resolves your query. Thanks.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by