Created
September 14, 2021 00:39
-
-
Save sergiolucero/583279345946062703d3936e5ab64214 to your computer and use it in GitHub Desktop.
This file contains 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
import matplotlib.pyplot as plt | |
conn=sqlite3.connect('revlocal.db') | |
sqloc = lambda q: pd.read_sql(q, conn) | |
odf = sqloc('SELECT * FROM stats_v1 ORDER BY Ocupación_Promedio DESC') | |
#odf=odf[odf.Ocupación_Minima>0]; | |
odf=odf[odf.Ocupación_Máxima<1.20] | |
fig = plt.figure(figsize=(20,16));odf['cod_hotel']=odf['cod_hotel'].apply(lambda x: x.rstrip()) | |
plt.hlines(y=odf['cod_hotel'],xmin=0, xmax = 100*odf['Ocupación_Promedio'], lw=8, color='cyan') #, color=my_color,linewidth=3, alpha =0.8) | |
#plt.scatter(x=100*odf['Ocupación_Minima'], y=range(len(odf)), color='red', s=80, alpha=1) #, color=my_color | |
plt.scatter(x=100*odf['Ocupación_Promedio'], y=range(len(odf)), color='yellow', s=400, alpha=1) #, color=my_color | |
plt.scatter(x=100*odf['Ocupación_Máxima'], y=range(len(odf)), color='green', s=400, alpha=1) #, color=my_color | |
plt.title("Hoteles ordenados por ocupación promedio y máxima", fontsize=20, x=0.5,y=1.02) | |
plt.xlabel('Ocupación Promedio', fontsize=20); plt.grid(True); plt.style.use("dark_background") | |
plt.ylabel('Hotel', fontsize=20); plt.yticks(fontsize=9);plt.xticks(fontsize=15); |
Author
sergiolucero
commented
Sep 14, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment