This file contains hidden or 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
#Group data by one variable. | |
df_group = df.groupby('Proceso').agg( | |
UX = ('UX', sum), | |
Impacto = ('Impacto', sum), | |
Uso = ('Uso', sum), | |
Implementación = ('Implementación', sum), | |
Prioridad = ('Prioridad', sum) | |
).reset_index() | |
df_group.head(20) |
This file contains hidden or 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
#Define scope of API. | |
scope = ['https://spreadsheets.google.com/feeds', | |
'https://www.googleapis.com/auth/drive'] | |
credentials = ServiceAccountCredentials.from_json_keyfile_name('./insertNameOfYourKeyFile.json', scope) #Get this file by activating the Google Sheets API from your Google account. | |
gc = gspread.authorize(credentials) | |
#Define spreadsheet variables. | |
spreadsheetKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
book = gc.open_by_key(spreadsheetKey) |
This file contains hidden or 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
#Create Pair Grid and assign colors. | |
g = sns.PairGrid(df_group, hue="Proceso", palette="husl") | |
g = g.map(plt.scatter, alpha=.5) | |
g = g.add_legend() |
This file contains hidden or 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
#Only keep columns needed. | |
df = df[['proceso', 'prioridad#', 'UX#', 'impacto#', 'uso#', 'implementación#']] | |
#Rename columns for presentation purposes. | |
df.columns = ['Proceso', 'Prioridad', 'UX', 'Impacto', 'Uso', 'Implementación'] | |
df.head() |
This file contains hidden or 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
#Install modules. | |
pip install gspread | |
pip install python-oauth2 | |
pip install --upgrade oauth2client | |
#Import libraries. | |
import pandas as pd | |
import seaborn as sns | |
import gspread | |
from oauth2client.service_account import ServiceAccountCredentials |