You are viewing a single comment's thread. Return to all comments →
import numpy as np import pandas as pd N = int(input()) input() data = [] missing = [] for i in range(N): line = input() year, month, t_min, t_max = line.split() if 'Missing' in t_min: t_min = np.NaN missing.append((i,'t_min')) if 'Missing' in t_max: t_max = np.NaN missing.append((i,'t_max')) data.append([float(t_min), float(t_max)]) df = pd.DataFrame(data, columns=['t_min','t_max']) df = df.interpolate('cubic', limit_direction='both') for i,col in missing: print(round(df.iloc[i][col],2))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 7: Temperature Predictions
You are viewing a single comment's thread. Return to all comments →