import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # Omitir warnings import warnings warnings.filterwarnings('ignore') # tamaƱo de figura fig = plt.figure(figsize=(12, 8)) # Lectura de csv df = pd.read_csv('https://vincentarelbundock.github.io/Rdatasets/csv/datasets/mtcars.csv') # Grafico ax = sns.regplot(x="wt", y="mpg", data=df) ax.set(xlabel='MPG', ylabel='WT') plt.title('Peso vs mpg') import pandas as pd import seaborn as sns df = pd.read_csv('https://raw.githubusercontent.com/marsja/jupyter/master/flanks.csv', index_col=0) # Grafico fig = plt.figure(figsize=(12, 8)) for condition in df.TrialType.unique(): cond_data = df[(df.TrialType == condition)] ax = sns.distplot(cond_data.RT, kde=False, label=condition) ax.set(xlabel='Tiempo de respuesta', ylabel='Frecuencia') ax.legend() ax.set_title('Histogramas Tiempo de respuesta') import pandas as pd import seaborn as sns # Leer el archivo df = pd.read_csv('https://vincentarelbundock.github.io/Rdatasets/csv/datasets/mtcars.csv', index_col=0) # Hacer la agrupacion df_grpd = df.groupby("cyl").count().reset_index() # Grafico fig = plt.figure(figsize=(12, 8)) sns.barplot(x="cyl", y="mpg", data=df_grpd) ax.set(xlabel='Cylinders', ylabel='Number of Cars for Each Cylinder') import pandas as pd import seaborn as sns df = pd.read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-02-26/full_trains.csv") plt.figure(figsize=(12, 8)) sns.lineplot(x="month", y="total_num_trips", hue="departure_station", ci=None, data=df[df.departure_station.str.contains('PARIS')]) plt.xlabel('Mes') plt.ylabel('Numer de viajes') plt.title('Viajes por mes') import pandas as pd import seaborn as sns df = pd.read_csv('https://vincentarelbundock.github.io/Rdatasets/csv/datasets/mtcars.csv', index_col=0) fig = plt.figure(figsize=(12, 8)) sns.boxplot(x="vs", y='wt', data=df) plt.title('Vs vs WT') !pip install ptitprince import pandas as pd import ptitprince as pt df = pd.read_csv('https://vincentarelbundock.github.io/Rdatasets/csv/datasets/iris.csv') ax = pt.RainCloud(x = 'Species', y = 'Sepal.Length', data = df, width_viol = .8, width_box = .4, orient = 'h', move = .0)