Skip to content

csfreebird/org-insight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

org-table-pytool

功能介绍

  1. 只提供python工具操纵org-table
    • dataframe内容可以生成org table, 方便查看数据
    • 读取org table内容,转换成python dataframe, 方便做数据分析
  2. 为保证工具的简洁, 不提供但可以自己使用丰富的python库,扩展自己的功能,比如:
    • 使用dataframe的函数进行数据统计
    • 使用第三方python工具生成报表

安装

进入org_insight目录,运行pip install .

如何使用

python DatgFrame的数据展示在org table内

  1. org_insight.my_table提供了函数toOrgTable,将python的dataframe的数据显示在org table里面
  2. org table要有#+RESULTS: 交易明细表
  3. src block要有#+name: 交易明细表, 和org table的#+RESULTS: 相同
  4. python dataframe的数据可以来自任何地方,例子中读取自mongodb
  5. src block的标记: #+begin_src python :results table :hlines yes

./imgs/实例1.png

读取org table转换成DataFrame

  1. org table 字段一行后面要有一行空行和水平分割线
  2. org table的name属性值 要赋给src blaock中的 :var t变量
  3. 使用org_insight.my_table.org_table_to_df函数,将t变量转换成dataframe并返回
  4. 然后就可以针对这个df使用python函数进行各种变幻
  5. 结果可以通过:results output直接print出来,也可以通过:results table,转换成新的org table显示出来

./imgs/实例2.jpg

About

python库,提供工具围绕org table形式进行数据分析和展示

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages