'how can I fill the missing values of my data, filling in the days (they are for minutes) and add "nan" to the missing data
thanks in advance, this is the code that i have right now: I have four columns of data, in one it is shown, the TIMESTAMP, the following GLOBALHORZ_avg, DNI_avg and DIFFHORZ_avg, each line should be separated by only one minute, the in the TIMESTAMP column, where I have missing values, I would like it to add the missing TIMESTAMP label (because sometimes the radiation sensor fails and stops taking data) and where data is missing, put NAN, so that I can make matrices with the exact amount of data.
import numpy as np #paquete funciones matemáticas
import datetime as dt #Formato
from numpy import nan
#cambiar el nombre de la columna de los data 1
df = pd.read_csv('Dir_Glob_Dif_29dic2020_17mar2022.csv')
df = df.rename(columns=({'Fecha':'TIMESTAMP'}))
df = df.rename(columns=({'RDirecta':'GLOBHORZ_Avg'}))
df = df.rename(columns=({'RGlobal':'DNI_Avg'}))
df = df.rename(columns=({'RDifusa':'DIFFHORZ_Avg'}))
# reading two csv files
dat_crud_2 =df
dat_crud_1 = pd.read_csv('datos_crudos_b_TH_GHI_DNI_DHI.csv')
#para unir los archivos
frames = [dat_crud_1,dat_crud_2]
result = pd.concat(frames)```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
