<repo_name>razemint/statistical-distribution<file_sep>/source.py
import pip
import seaborn as sns
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
from IPython import get_ipython


np.random.seed(2019)

sns.set_palette("deep", desat=.6)
sns.set_context(rc={"figure.figsize": (8, 4)})

mu, sigma = 0, 0.2
datos = np.random.normal(mu, sigma, 1000)

cuenta, cajas, ignorar = plt.hist(datos, 20)
plt.ylabel('memo')
plt.xlabel('irvinho')
plt.title('memo sobre irvinho')
plt.show()
<file_sep>/crab_a2.py
from tkinter import *

#border = El borde de la pantalla, orillas y todo

border = Tk()
border.title("Distribucion de probabilidad")
border.resizable(0, 0)
border.geometry("800x650")
border.iconbitmap("sources/bordericon_a.ico")
border.config(bg="#3F3F3F")

#variables

box_text_x_num = StringVar()
box_text_y_num = StringVar()

#mainFrame = La ventana principal

mainFrame = Frame(border)
mainFrame.config(bg="#4c4c4c")
mainFrame.config(width="790", height="645")
mainFrame.pack()

#mainFrameImg = PhotoImage(file = "sources/mainframeimg.png")

#mainLabel = Titulo FES

mainLabel = Label(mainFrame, text="Facultad de Estudios Superiores\nAragón")
mainLabel.place(x=212, y=250)
mainLabel.config(fg="#FFFFFF", bg="#3F3F3F", font=("Verdana", 20))
mainLabel.pack()

#crabFrame = Para los cuadros de texto

crabFrame = Frame(mainFrame)
crabFrame.config(bg="#4c4c4c")
crabFrame.pack()

#box_text_x = Caja uno

box_text_x = Entry(crabFrame, textvariable = box_text_x_num)
box_text_x.grid(row=0, column=1)

box_text_x_label = Label(crabFrame, text="crab that goes in X:")
box_text_x_label.grid(row=0, column=0, pady=10)
box_text_x_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 10))

#box_text_y = Caja dos

box_text_y = Entry(crabFrame, textvariable = box_text_y_num)
box_text_y.grid(row=1, column=1)

box_text_y_label = Label(crabFrame, text="crab that goes in Y:")
box_text_y_label.grid(row=1, column=0, pady=10)
box_text_y_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 10))

#def get_x = Para guardar X

def box_text_x_get():
    box_text_x_num.get()

#def get_y = Para guardar Y

def box_text_y_get():
    box_text_y_num.get()

#button_end = Boton para resolver

button_end=Button(mainFrame, text="Resolver", command=(box_text_x_get, box_text_y_get))
button_end.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 15))

border.mainloop()<file_sep>/inicio.py
import numpy as np
from cal.simpson import simpson13, fx

n = int(input("inserta el número de iteraciones\n"))
a = float(input("inserta intervalo inferior\n"))
b = float(input("inserta intervalo superior\n"))
f = str(input("inserta la función\n"))


print("el resultado de la integral es: ")
print(simpson13(n, a, b, f))
<file_sep>/README.md
# statistical-distribution
statistical distribution with python
<file_sep>/test_.py
print("haras una puta suma o una puta resta?")
inputa = str(input())

if inputa == ("suma"):
    resultado = 1+1
    print(resultado)

elif inputa == ("resta"):
    resultado = 1-1
    print(resultado)

else:
    print("vales verga")
<file_sep>/crab_a1.py
from tkinter import *

#border = El borde de la pantalla, orillas y todo

border = Tk()
border.title("Distribucion de probabilidad")
border.resizable(0, 0)
border.geometry("800x650")
border.iconbitmap("sources/bordericon_a.ico")
border.config(bg="#3F3F3F")

#mainFrame = La ventana principal

mainFrame = Frame(border)
mainFrame.config(bg="#4c4c4c")
mainFrame.config(width="790", height="645")
mainFrame.pack()

mainFrameImg = PhotoImage(file = "sources/mainframeimg.png")

#mainLabel = Titulo FES

mainLabel = Label (mainFrame, text="Facultad de Estudios Superiores\nAragon", justify="center")
mainLabel.place(x=212, y=30)
mainLabel.place(bordermode="inside")
mainLabel.config(fg="#FFFFFF")
mainLabel.config(bg="#4c4c4c")
mainLabel.config(font=("Verdana", 18))


border.mainloop()<file_sep>/crab_a3.py
from tkinter import *

#border = El borde de la pantalla, orillas y todo

border = Tk()
border.title("Distribucion de probabilidad")
border.resizable(0, 0)
border.geometry("800x650")
border.iconbitmap("sources/bordericon_a.ico")
border.config(bg="#3F3F3F")

#variables

box_text_simp_int_inf_num = StringVar()
box_text_simp_int_sup_num = StringVar()
box_text_simp_init_num = StringVar()
box_text_simp_func_num = StringVar()

#mainFrame = La ventana principal

mainFrame = Frame(border)
mainFrame.config(bg="#4c4c4c")
mainFrame.config(width="790", height="645")
mainFrame.pack()

#mainFrameImg = PhotoImage(file = "sources/mainframeimg.png")

#mainLabel = Titulo FES

mainLabel = Label(mainFrame, text="Facultad de Estudios Superiores\nAragón")
mainLabel.place(x=212, y=250)
mainLabel.config(fg="#FFFFFF", bg="#3F3F3F", font=("Verdana", 20))
mainLabel.pack()

#crabFrame = Para los cuadros de texto

crabFrame = Frame(mainFrame)
crabFrame.config(bg="#4c4c4c")
crabFrame.pack()

#simpFrame = Para los cuadros de texto

simpFrame = Frame(crabFrame)
simpFrame.config(bg="#4c4c4c")
simpFrame.pack()

#----------------Simpson 1/3------------------

#box_text_simp_label = "Metodo Simpson 1/3"

box_text_simp_label = Label(simpFrame, text="Metodo Simpson 1/3")
box_text_simp_label.grid(row=0, column=0)
box_text_simp_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 18))

#box_text_simp_int_inf = Caja uno

box_text_simp_int_inf = Entry(simpFrame, textvariable = box_text_simp_int_inf_num)
box_text_simp_int_inf.grid(row=1, column=1)

box_text_simp_int_inf_label = Label(simpFrame, text="Intervalo Inferior:")
box_text_simp_int_inf_label.grid(row=1, column=0, pady=10)
box_text_simp_int_inf_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 10))

#box_text_simp_int_sup = Caja dos

box_text_simp_int_sup = Entry(simpFrame, textvariable = box_text_simp_int_sup_num)
box_text_simp_int_sup.grid(row=2, column=1)

box_text_simp_int_sup_label = Label(simpFrame, text="Intervalo Superior:")
box_text_simp_int_sup_label.grid(row=2, column=0, pady=10)
box_text_simp_int_sup_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 10))

#box_text_simp_init = Caja tres

box_text_simp_init = Entry(simpFrame, textvariable = box_text_simp_init_num)
box_text_simp_init.grid(row=3, column=1)

box_text_simp_init_label = Label(simpFrame, text="Iteraciones:")
box_text_simp_init_label.grid(row=3, column=0, pady=10)
box_text_simp_init_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 10))

#box_text_simp_func = Caja cuatro

box_text_simp_func = Entry(simpFrame, textvariable = box_text_simp_func_num)
box_text_simp_func.grid(row=4, column=1)

box_text_simp_func_label = Label(simpFrame, text="Funcion:")
box_text_simp_func_label.grid(row=4, column=0, pady=10)
box_text_simp_func_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 10))

def box_text_simp_int_inf_get():
    box_text_simp_int_inf_num.get()

def box_text_simp_int_sup_get():
    box_text_simp_int_sup_num.get()

def box_text_simp_init_get():
    box_text_simp_init_num.get()

def box_text_simp_func_get():
    box_text_simp_func_num.get()

#button_simp = Boton para resolver

button_simp=Button(simpFrame, text="Resolver")
button_simp.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 15))
button_simp.grid(row=5, column=0, pady=10)

#box_text_simp_ans = Caja cinco

box_text_simp_ans = Entry(simpFrame, text="")
box_text_simp_ans.grid(row=5, column=1)

#----------------Simpson 1/3------------------

border.mainloop()<file_sep>/test.py
import scipy.stats as ss
import numpy as np
import matplotlib.pyplot as plt

a = int(input("inserta mu"))
b = int(input("inserta mu"))
c = int(input("inserta mu"))


x = np.random.normal(a, b, c)
print(x)


print(np.var(x))
print(np.average(x))
<file_sep>/Untitled-2.py
from tkinter import *

root = Tk()

def testVal(inStr,acttyp):
    if acttyp == '1': #insert
        if not inStr.isdigit():
            return False
    return True

entry = Entry(root, validate="key")
entry['validatecommand'] = (entry.register(testVal),'%P','%d')
entry.pack()

root.mainloop()<file_sep>/simpson_ship.py
from math import *
import numpy as np
import matplotlib.pyplot as plt

def simpson13(n, a, b, f):
    h = (b - a) / n

    suma = 0.0

    for i in range(1, n):
        x = a + i * h

        if(i % 2 == 0):
            suma = suma + 2 * fx(x, f)
        else:
            suma = suma + 4 * fx(x, f)

    suma = suma + fx(a, f) + fx(b, f)
    rest = suma * (h / 3)

    return (rest)


def fx(x, f):
    return eval(f)

<file_sep>/cal/normal.py
import scipy.stats as ss
import numpy as np
import matplotlib.pyplot as plt

media, desviacion_estandar = 16.666, 3.7267
normal = ss.norm(media, desviacion_estandar)
x = np.linspace(normal.ppf(0.01),
                normal.ppf(0.99), 100)
fp = normal.pdf((x))
plt.plot(x, fp)
plt.title('Distribución de probabilidad Normal')
plt.ylabel('probabilidad')
plt.xlabel('valores')
plt.show()
<file_sep>/crab_a5_1.py
from tkinter import *
import os;

#buttomSimpPress = Soluciona el problema

def buttonSimpPress():
  simpCommand = '\"\"inicio.py"\"'
  os.system(simpCommand)

def buttonNormPress():
  normCommand = '\"\"cal\\normal.py"\"'
  os.system(normCommand)

#border = El borde de la pantalla, orillas y todo

border = Tk()
border.title("Distribucion de probabilidad")
border.resizable(0, 0)
border.geometry("800x650")
border.iconbitmap("sources/bordericon_a.ico")
border.config(bg="#3F3F3F")

#mainFrame = La ventana principal

mainFrame = Frame(border)
mainFrame.config(bg="#4c4c4c")
mainFrame.config(width="790", height="645")
mainFrame.pack()

#mainFrameImg = PhotoImage(file = "sources/mainframeimg.png")

#mainLabel = Titulo FES

mainLabel = Label(mainFrame, text="Facultad de Estudios Superiores\nAragón")
mainLabel.place(x=212, y=250)
mainLabel.config(fg="#FFFFFF", bg="#3F3F3F", font=("Verdana", 20))
mainLabel.pack()

#crabFrame = Para los cuadros de texto

crabFrame = Frame(mainFrame)
crabFrame.config(bg="#4c4c4c")
crabFrame.pack()

#simpFrame = Para los cuadros de texto

simpFrame = Frame(crabFrame)
simpFrame.config(bg="#4c4c4c")
simpFrame.pack()

#----------------Simpson 1/3------------------

#box_text_simp_label = "Metodo Simpson 1/3"

box_text_simp_label = Label(simpFrame, text="Metodo Simpson 1/3")
box_text_simp_label.grid(row=0, column=0)
box_text_simp_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 18))

#button_simp = Boton para resolver

button_simp=Button(simpFrame, text="Introducir Valores", command=buttonSimpPress)
button_simp.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 15))
button_simp.grid(row=1, column=0, pady=10)

#----------------Simpson 1/3------------------

#------------Distribución normal--------------

#box_text_norm_label = "Distribución Normal"

box_text_norm_label = Label(simpFrame, text="Metodo de Distribución Normal")
box_text_norm_label.grid(row=2, column=0)
box_text_norm_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 18))

#button_norm = Boton para resolver

button_norm=Button(simpFrame, text="Introducir Valores", command=buttonNormPress)
button_norm.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 15))
button_norm.grid(row=3, column=0, pady=10)

#------------Distribución normal--------------

#-----------------Varianza--------------------

#box_text_norm_label = "Distribución Normal"

box_text_vari_label = Label(simpFrame, text="Varianza")
box_text_vari_label.grid(row=4, column=0)
box_text_vari_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 18))

#button_norm = Boton para resolver

button_vari=Button(simpFrame, text="Introducir Valores", command=buttonNormPress)
button_vari.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 15))
button_vari.grid(row=5, column=0, pady=10)

#-----------------Varianza--------------------

#--------------Valor Esperado-----------------

#box_text_norm_label = "Distribución Normal"

box_text_exp_label = Label(simpFrame, text="Valor Esperado")
box_text_exp_label.grid(row=6, column=0)
box_text_exp_label.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 18))

#button_norm = Boton para resolver

button_exp=Button(simpFrame, text="Introducir Valores", command=buttonNormPress)
button_exp.config(fg="#FFFFFF", bg="#4c4c4c", font=("Verdana", 15))
button_exp.grid(row=7, column=0, pady=10)

#--------------Valor Esperado-----------------

border.mainloop()