美文网首页
补全数据并插值

补全数据并插值

作者: Aerosols | 来源:发表于2021-12-26 21:50 被阅读0次

来自“补全excel中缺失的行”

import numpy as np
import pandas as pd 
import matplotlib as mpl
import datetime


path = r"D:\BCf\Dry\era5\coef_24days_gaussfit.xlsx"
data = pd.read_excel(path,sheet_name = "2019_12_blh",parse_dates=[1],index_col = 1,header=0)

t_index = pd.date_range("2019-12-7 8:00","2020-01-01 7:00",freq="0.5H")
data = data.reindex(t_index)

pd.DataFrame(data["blh(m)"].interpolate(method = "linear",limit_direction = "both")).to_csv(r"D:\BCf\Dry\era5\blh_interpolate.csv")

相关文章

网友评论

      本文标题:补全数据并插值

      本文链接:https://www.haomeiwen.com/subject/hzkeqrtx.html