This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================= | |
| # Abraham Zamudio [GMMNS] | |
| # 2020/06/13 | |
| # Lima-Peru | |
| # ============================================================================= | |
| # | |
| # La data proviene de : | |
| # https://www.osinergmin.gob.pe/seccion/institucional/regulacion-tarifaria/publicaciones/regulacion-tarifaria | |
| # Explorar : |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### Primeros pasos #### | |
| library(quantmod) | |
| library(help= quantmod) | |
| #### carguemos datos financieros #### | |
| help(getSymbols) | |
| # descarguemos los precios de la empresa IBM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sessionInfo() | |
| library(help= datasets) | |
| #### ggplot2 #### | |
| library(ggplot2) | |
| library(car) | |
| #### cargamos datos #### | |
| data(Salaries) | |
| class(Salaries) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Implementamos un par de funciones que nos permitan obtener la composicion de ETFs | |
| from bs4 import BeautifulSoup | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| import re | |
| import requests | |
| import numpy as np | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data = [ | |
| 446.6565, | |
| 454.4733, | |
| 455.663, | |
| 423.6322, | |
| 456.2713, | |
| 440.5881, | |
| 425.3325, | |
| 485.1494, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def visualizar_clasificador(clasificador, X, y): | |
| #definimos los máximos valores de X e y para la malla | |
| min_x, max_x = X[:, 0].min() - 1.0, X[:, 0].max() + 1.0 | |
| min_y, max_y = X[:, 1].min() - 1.0, X[:, 1].max() + 1.0 | |
| #definimos el paso de la malla | |
| mesh_step_size = 0.01 | |
| #definimos la malla para x e y | |
| x_vals, y_vals = np.mgrid[min_x:max_x:mesh_step_size, min_y:max_y:mesh_step_size] | |
| #corremos el clasificador sobre la malla | |
| resultados = clasificador.predict(np.c_[x_vals.ravel(), y_vals.ravel()]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def show_values(axs, orient="v", space=.01): | |
| def _single(ax): | |
| if orient == "v": | |
| for p in ax.patches: | |
| _x = p.get_x() + p.get_width() / 2 | |
| _y = p.get_y() + p.get_height() + (p.get_height()*0.01) | |
| value = '{:.1f}'.format(p.get_height()) | |
| ax.text(_x, _y, value, ha="center") | |
| elif orient == "h": | |
| for p in ax.patches: |