This file contains 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
import math as m | |
import random as rnd | |
import os | |
r = print("Ingresa el radio de la circunferencia : ") | |
AreaCirculo = m.pi*complex(r)+2 | |
print("El area del circulo es : ", AreaCirculo) |
This file contains 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
import math as m | |
import random as rnd | |
import os | |
r = input("Ingresa el radio de la circunferencia : ") | |
AreaCirculo = m.os*float(r)**2 | |
print("El area del circulo es : ", r+2) |
This file contains 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
import math as m | |
import random as rnd | |
import os | |
r = input("Ingresa el radio de la circunferencia : ") | |
AreaCirculo = rnd.pi*float(r)+2 | |
print("El area del circulo es : ", AreaCirculo) |
This file contains 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
import math as m | |
import random as rnd | |
import os | |
r = input("Ingresa el radio de la circunferencia : ") | |
AreaCirculo = m.pi*float(r)+2 | |
print("El area del circulo es : ", AreaCirculo) |
This file contains 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
import math as m | |
import random as rnd | |
import os | |
r = input("Ingresa el radio de la circunferencia : ") | |
AreaCirculo = m.pi*float(r)**2 | |
print("El area del circulo es : ", AreaCirculo) |
This file contains 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
# Gráfico de correlograma | |
def plot_correlogram(x, lags=None, title=None): | |
lags = min(10, int(len(x)/5)) if lags is None else lags | |
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(14, 8)) | |
x.plot(ax=axes[0][0], title='Time Series') | |
x.rolling(21).mean().plot(ax=axes[0][0], c='k', lw=1) | |
q_p = np.max(q_stat(acf(x, nlags=lags), len(x))[1]) | |
stats = f'Q-Stat: {np.max(q_p):>8.2f}\nADF: {adfuller(x)[1]:>11.2f}' | |
axes[0][0].text(x=.02, y=.85, s=stats, transform=axes[0][0].transAxes) |
This file contains 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
patrones = [ | |
(r"[Aa]m$", "BEM"), # irregular forms of 'to be' | |
(r"[Aa]re$", "BER"), # | |
(r"[Ii]s$", "BEZ"), # | |
(r"[Ww]as$", "BEDZ"), # | |
(r"[Ww]ere$", "BED"), # | |
(r"[Bb]een$", "BEN"), # | |
(r"[Hh]ave$", "HV"), # irregular forms of 'to have' | |
(r"[Hh]as$", "HVZ"), # | |
(r"[Hh]ad$", "HVD"), # |
This file contains 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
try: | |
f = open('fichero.txt') # El fichero no existe | |
except ... : | |
print('¡El fichero no existe!') | |
else: | |
print(f.read()) |
This file contains 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
class Perro: | |
# El método __init__ es llamado al crear el objeto | |
def __init__(self, nombre, raza): | |
print(f"Creando perro {nombre}, {raza}") | |
# Atributos de instancia | |
self.nombre = nombre | |
self.raza = raza | |
mi_perro = Perro("Toby", "Bulldog") |
This file contains 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
# Instalamos el jdk (java) | |
!apt-get install openjdk-8-jdk-headless -qq > /dev/null | |
# Descargamos spark | |
!wget https://dlcdn.apache.org/spark/spark-3.4.0/spark-3.4.0-bin-hadoop3.tgz | |
# Descomprimimos el binario de spark | |
!tar xvzf spark-3.4.0-bin-hadoop3.tgz | |
# Cargamos el modulo os |
NewerOlder