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
Collecting pyperclip==1.8.2
Downloading pyperclip-1.8.2.tar.gz (20 kB)
Building wheels for collected packages: pyperclip
Building wheel for pyperclip (setup.py) ... done
Created wheel for pyperclip: filename=pyperclip-1.8.2-py3-none-any.whl size=11106 sha256=0a858d28a08fc1edda0978ae639733640455f1768bb82017dff609127694acc6
Stored in directory: /root/.cache/pip/wheels/9f/18/84/8f69f8b08169c7bae2dde6bd7daf0c19fca8c8e500ee620a28
Successfully built pyperclip
Installing collected packages: pyperclip
Successfully installed pyperclip-1.8.2
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/root/venv/bin/python -m pip install --upgrade pip' command.
import pyperclip
pip install gtk
ERROR: Could not find a version that satisfies the requirement gtk (from versions: none)
ERROR: No matching distribution found for gtk
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Note: you may need to restart the kernel to use updated packages.
df_c = pd.read_clipboard()
df_c
Execution Error
PyperclipException:
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit
https://pyperclip.readthedocs.io/en/latest/#not-implemented-error
pip install xsel
ERROR: Could not find a version that satisfies the requirement xsel (from versions: none)
ERROR: No matching distribution found for xsel
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Note: you may need to restart the kernel to use updated packages.
sns.relplot(dfg1, x="gestion", y="indice", hue="indicador")
/shared-libs/python3.7/py/lib/python3.7/site-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variable as a keyword arg: x. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
FutureWarning
Execution Error
ValueError: Could not interpret value `indice` for parameter `y`
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)
Execution Error
IndentationError: unexpected indent (<ipython-input-8-86dd16f236d6>, line 5)
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"));