面向deepeye的python包:面向自动数据可视化api
deepeye-pack的Python项目详细描述
深眼套装
更新-2018/10/22 v0.0.2
- 阅读“更改日期”修改为“熊猫”方法
- 两种导入方法都需要强制table\u info来指定表
- mysql_handle现在更改为pandas dataframe verison
- 从mysql也更改为para方法,pass port/user/db…而不是query和mysqldb conn
说明
- 这是一个用于deepeye api的python包,可以轻松地可视化数据,而无需太多努力。并提供真正简单的用法
- 深海眼系统:https://github.com/TsinghuaDatabaseGroup/DeepEye/tree/master/APIs_Deepeye
安装
- python 2.7版
- mysql 5.7版
- 包装
- 用于windows的mysqldb二进制软件包:link1:https://www.lfd.uci.edu/~gohlke/pythonlibs/
link2:https://sourceforge.net/projects/mysql-python/- 下载mysql python并为其选择正确的版本
- 逐个车轮安装.whl
- 此存储库中的“mysqldb”文件夹下有一个备份版本
- Numpy(最新版本)
- 熊猫(最新版本)高于0.23.0版
- 用于windows的mysqldb二进制软件包:link1:https://www.lfd.uci.edu/~gohlke/pythonlibs/
用法
- 首字母
- 示例代码:
importdeepeye_pack#create a deepeye_pack class that wraps everythingdp=deepeye_pack.deepeye('demo')# the name here doesnt actually matter# then user needs to input table info# as in table_info(table_name,column_names,column_types)dp.table_info('electricity',['city','date','electricity(kWh)'],['varchar','date','float'])
- Deepeye_Pack支持的列类型指定如下:
- 数值:
int
,float
,double
- 时间:
date
,datetime
,year
- 分类:
char
,varchar
- 数值:
- 进口
- 来自mysql()
# call the from_mysql() functiondp.from_mysql(host='localhost',port=3306,user='root',passwd='ppww',db='deepeye',query='SELECT * FROM `table_name`')
- 来自CSV()
path="file.csv"# the path where the file locateddp.from_csv(path)
- 来自mysql()
- 可视化
# choose one from threedp.learning_to_rank()dp.partial_order()dp.diversified_ranking()
- 输出
# can use several different methods at the same timedp.to_print_out()dp.to_single_json()dp.to_multiple_jsons()dp.to_multiple_htmls()dp.to_single_html()