<jupyter_start><jupyter_text>Pregunta 1<jupyter_code>tabla = pd.DataFrame({ 'rend':[-0.15, -0.2, 0.3, 0.2, 0.1]})
tabla
#rendimiento medio geometrico
(1+tabla).prod()**(1/5)-1<jupyter_output><empty_output><jupyter_text>Pregunta 2<jupyter_code>tabla
#rendimiento medio aritmético
tabla.mean()<jupyter_output><empty_output><jupyter_text>Pregunta 3<jupyter_code>tabla
#desviación de los rendimientos 
tabla.std()<jupyter_output><empty_output><jupyter_text>Pregunta 4<jupyter_code>tablaa = pd.DataFrame({'ret':[-.10, 0.15, 0.30]})
tablaa
#rendimiento medio geometrico
(1+tablaa).prod()**(1/3)-1<jupyter_output><empty_output><jupyter_text>Pregunta 5<jupyter_code>tabla2 = pd.DataFrame({'prob':[0.3, 0.4, 0.3], 'ret':[0.10, 0.05, 0.00]})
tabla2
Er = (tabla2['prob'] * tabla2['ret']).sum()
Er
sr2 = (tabla2['prob'] * (tabla2['ret'] - Er)**2).sum()
sr2
# desviación estándar
sr = sr2**0.5
sr<jupyter_output><empty_output><jupyter_text>Pregunta 6<jupyter_code>tabla3 = pd.DataFrame({'ret':[-.10, 0.20, 0.30]})
tabla3
#rendimiento medio aritmético
tabla3.mean()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19518963922294172, 'fraction_numerical': 0.06567992599444958, 'mean_word_length': 8.491228070175438, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '558258', 'license': 'MIT', 'n_tokens_mistral': 539, 'n_tokens_neox': 518, 'n_words': 64, 'path': 'Modulo1/quiz 2.ipynb', 'repo_name': 'ariadnagalindom/portafolios', 'size': '1081'}