python : bokeh 画基金净值线

python bokeh : 交互式 Web 图表绘制

数据格式同上几篇

date,jz0,jz1,jz2,jz3,jz4,jz5

http://pypi.python.org
Downloading bokeh-0.12.13.tar.gz (15.4MB)

解压 bokeh-0.12.13.tar.gz
setup.py install

会连互联网下载一些依赖包

bokeh_line6.py

# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import bokeh.plotting as bp

# dataFrame 
df = pd.read_csv('/python/66001_.txt', parse_dates=['date'])

# Configuring plot output file
bp.output_file("fund_value_1.html", title="Fund net value")

# Create the figure and define some properties
fig = bp.figure(title=u"基金净值图", width=1000,
                x_axis_label='date', y_axis_label='value', x_axis_type="datetime")

# add 6 lines
fig.line(df['date'], df['jz0'], color="black", legend='660010')
fig.line(df['date'], df['jz1'], color="blue",  legend='660011')
fig.line(df['date'], df['jz2'], color="green", legend='660012')
fig.line(df['date'], df['jz3'], color="yellow",legend='660013')
fig.line(df['date'], df['jz4'], color="red",   legend='660014')
fig.line(df['date'], df['jz5'], color="purple",legend='660015')

bp.show(fig)

参考书:[ Python for Finace ]
http://bokeh.pydata.org

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值