<jupyter_start><jupyter_text>Crea una nueva columna$$Tsa = T_o +  \frac{I_s * a} { h} -RF$$<jupyter_code>h = 13.
a = 0.3
RF = 3.9
tmx['Tsa'] = tmx.To +  tmx.Ig * a /h - RF
tmx
tmx[['Tsa','To']].loc['2018-03-10'].plot(figsize=(12,4))<jupyter_output><empty_output><jupyter_text>Borra una columna<jupyter_code>tmx['Tsaa'] = tmx.To + tmx.Ig * a /h 
tmx
del tmx['Tsaa']  # Solo se puede borrar una vez
tmx<jupyter_output><empty_output><jupyter_text>Problema, haz NaN la irradiancia para poder calcular el promedio mensual de Ig<jupyter_code>tmx_nan = tmx.copy()
tmx_nan.loc[tmx_nan.Ig<= 0.,'Ig'] = float('NaN')
tmx_nan
tmx
tmx_nan.resample('D').mean() # comparar Ig en tmx
tmx.resample('D').mean()
tmx.loc['2018-03-10'].resample('D').mean()<jupyter_output><empty_output><jupyter_text>Calcula la energ'ia Anual, mensual, diaria $$ E = \sum I_g \Delta t $$<jupyter_code>energia_anual = tmx[['Ig','Ib']].resample('Y').sum()*(1/6)
energia_anual
energia_anual.plot(kind='bar')
energia_mensual = tmx[['Ig','Ib']].resample('M').sum()*(1/6)
energia_mensual
energia_mensual.plot(kind='bar',figsize=(12,4))
(tmx[['Ig','Ib']].loc['2018-03'].resample('D').sum()*1/6).plot(kind='bar',figsize=(20,3))

(tmx[['Ig','Ib']].loc['2018-03'].resample('D').sum()*1/6)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2283464566929134, 'fraction_numerical': 0.04094488188976378, 'mean_word_length': 6.94375, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '51600', 'license': 'MIT', 'n_tokens_mistral': 640, 'n_tokens_neox': 595, 'n_words': 83, 'path': 'notebooks/dia_05/001_OperacionesBasicas.ipynb', 'repo_name': 'AltamarMx/crash_course_Python', 'size': '1270'}