Aquesta és una revisió antiga del document
Python Pandas
pip3 install pandas- soporte para excel:
pip3.9 install openpyxl # needed to load Excel .xlsx files pip3.9 install xlrd # needed to load Excel old .xls files)
bokeh ejemplos
from bokeh.plotting import figure, output_file, show p=figure(width=500,height=400, tools='pan') p.title.text="Cool Data" p.title.text_color="Gray" p.title.text_font="times" p.title.text_font_style="bold" p.xaxis.minor_tick_line_color=None p.yaxis.minor_tick_line_color=None p.xaxis.axis_label="Date" p.yaxis.axis_label="Intensity" p.line([1,2,3],[4,5,6]) output_file("graph.html") show(p)
pandas + bokeh ejemplos
# segundo bokeh plot con pandas from bokeh.plotting import figure from bokeh.io import output_file, show import pandas df=pandas.read_csv("https://pythonizing.github.io/data/bachelors.csv") x=df["Year"] y=df["Engineering"] output_file("Line.html") f=figure() f.line(x,y) show(f)
import pandas from bokeh.plotting import figure, output_file, show df=pandas.read_excel("https://github.com/pythonizing/data/blob/master/verlegenhuken.xlsx",sheet_name=0) df["Temperature"]=df["Temperature"]/10 df["Pressure"]=df["Pressure"]/10 p=figure(plot_width=500,plot_height=400,tools='pan') p.title.text="Temperature and Air Pressure" p.title.text_color="Gray" p.title.text_font="arial" p.title.text_font_style="bold" p.xaxis.minor_tick_line_color=None p.yaxis.minor_tick_line_color=None p.xaxis.axis_label="Temperature (°C)" p.yaxis.axis_label="Pressure (hPa)" p.circle(df["Temperature"],df["Pressure"],size=0.5) output_file("Weather.html") show(p)