Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Put NaN values to incomplete records
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
Hello:
I have 3-hourly records for a daily time series records with lot of missing values for 30-yrs. Since 3-hourly records have 8 observations/day, I want to check for whether I have at least 4 records/day in the series. If I have less than that I want to discard that particular record and substitute NaN value. Could anyone please show how to achieve this. I am putting a reference series here.
댓글 수: 3
  Jan
      
      
 2022년 6월 12일
				
      편집: Jan
      
      
 2022년 6월 12일
  
			You have posted a text file. can we assume, that you are able to import the data already? Does exporting the result belong to the problem?
You want to set what exactly to NaN? What is "that particular record", if there are less then 4 records?
As far as I can see, in the given example you want to set all values of the last 4 columns to NaN. Then this is not a useful example. Maybe this is clearer:
1992	4	12	0	NaN	NaN	NaN	NaN
1992	4	12	3	NaN	NaN	NaN	NaN
1992	4	12	6	49.96	15.60	5.20	10.17    % Keep: >= 4 records
1992	4	12	9	32.06	21.00	3.70	11.85    % Keep: >= 4 records
1992	4	12	12	32.06	21.00	3.70	11.85    % Keep: >= 4 records
1992	4	12	15	32.06	21.00	3.70	11.85    % Keep: >= 4 records
1992	4	12	18	NaN	NaN	NaN	NaN
1992	4	12	21	89.18	10.00	8.30	9.10     % Remove: >= 4, but
1992	4	13	0	89.18	10.00	8.30	9.10     % not on one day
1992	4	13	3	89.18	10.00	8.30	9.10
1992	4	13	6	89.18	10.00	8.30	9.10
1992	4	13	9	NaN	NaN	NaN	NaN
1992	4	13	12	NaN	NaN	NaN	NaN
1992	4	13	15	22.96	25.00	2.40	12.98    % Remove: < 4 records
1992	4	13	18	NaN	NaN	NaN	NaN
1992	4	13	21	NaN	NaN	NaN	NaN
  Ganesh Gudipati
    
 2022년 6월 15일
				Hi Poulomi,
As per my understanding, the first 4 columns represents year, month,date and time. The next 4 columns represents the observations you are recording for every 3 hours. When they are NaN it means data is not recorded at that particular point of time. So if data recorded <4 times in day you want to make all the recodings on that particular day to NaN.
Is that what you wanted?
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



