2+3
import seaborn as sns
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
df = pd.read_excel("/work/g2_v.xlsx")
df.dtypes
df["gestion"]=pd.Categorical(df["gestion"])
sns.heatmap(df.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":16})
type(g)
df2 = pd.read_excel("/work/g2.xlsx")
df2["year"]=pd.Categorical(df2["year"])
cars = sns.load_dataset("mpg")
cuadro = cars.groupby("origin").cylinders.value_counts().unstack()
type(cuadro)
dfg1=pd.read_excel("/work/g1v.xlsx")
dfg1.dtypes
!pip install pyperclip==1.8.2
import pyperclip
pip install gtk
df_c = pd.read_clipboard()
df_c
pip install xsel
sns.relplot(dfg1, x="gestion", y="indice", hue="indicador")
dfg1
fmri=sns.load_dataset("fmri")
dfeje.dtypes
dfg1.dtypes
df_g1_g3 = pd.read_excel("/work/g1_g3.xlsx")
df_g1_g3
df_g1_g3.columns
sns.relplot(x="gestion", y="indice", hue="depto", style="depto",
col="indicador", col_wrap=5,
height=3, aspect=.75, linewidth=2.5,
kind="line", data=df_g1_g3.query("grupo == 'g2'"))
sns.set_context("notebook", font_scale=1.25)
df_g1_g3.dtypes
sns.relplot(x="gestion", y="indice", hue="depto", style="depto",
col="indicador", col_wrap=5,
height=3.5, aspect=.75, linewidth=2.5,
kind="line", data=df_g1_g3.query("grupo == 'g2' and gestion <= 2019"));
data=df_g1_g3.query("grupo == 'g2' and depto == 'La Paz' and gestion <= 2019")
matriztot = data.groupby(["gestion" , "indicador"])["indice"].mean().unstack()
matriztot
type(matrizg1)
matrizg3.dtypes
sns.heatmap(matriztot.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":8})
data=df_g1_g3.query("depto == 'La Paz' and gestion <= 2019")
data
sns.heatmap(data.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":15})
df = pd.read_excel("/work/g1_g4.xlsx")
data=df.query("depto == 'La Paz' and gestion <= 2019 and gestion >= 2012")
data
matriztot = data.groupby(["gestion" , "indicador"])["indice"].mean().unstack()
matriztot
sns.clustermap(matriztot, figsize=(4,4))
matriztot
sns.heatmap(matriztot.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":5})
data_g1_g2=df.query("grupo == 'g1' or grupo == 'g2' and depto == 'La Paz' and gestion <= 2019")
matriztot_g12 = data_g1_g2.groupby(["gestion" , "indicador"])["indice"].mean().unstack()
matriztot_g12
sns.heatmap(matriztot_g12.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":9})
data_g3_g4=df.query("grupo == 'g3' or grupo == 'g4' and depto == 'La Paz' and gestion <= 2019")
matriztot_g34 = data_g3_g4.groupby(["gestion" , "indicador"])["indice"].mean().unstack()
sns.heatmap(matriztot_g34.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":9})
data
matriztot = df.groupby(["gestion" , "indicador"])["indice"].mean().unstack()
matriztot
sns.heatmap(matriztot.corr(), cmap= "Greens", annot=True, linewidths=1,
annot_kws = { "fontsize":7})
data=df.query("depto == 'La Paz' and gestion <= 2019")
4==6
data=df.query("depto == 'La Paz' and gestion <= 2019")
type(data)
data
sns.relplot(x="gestion", y="indice", hue="depto", style="depto",
col="indicador", col_wrap=3,
height=3.5, aspect=.75, linewidth=2.5,
kind="line", data=df.query("grupo == 'g4' and gestion <= 2019"));