# I Ching Python project
![](https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/I_Ching_Song_Dynasty_print.jpg/440px-I_Ching_Song_Dynasty_print.jpg)
iching is a packge developed by Cheng-Jun Wang. It employs the method of Shicao prediction to reproduce the prediction of I Ching--the Book of Exchanges. The I Ching ([î tɕíŋ]; Chinese: 易經; pinyin: Yìjīng), also known as the Classic of Changes or Book of Changes in English, is an ancient divination text and the oldest of the Chinese classics.
![](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Yarrow_stalks_for_I_Ching.JPG/440px-Yarrow_stalks_for_I_Ching.JPG)
The Zhou yi provided a guide to cleromancy that used the stalks of the yarrow plant, but it is not known how the yarrow stalks became numbers, or how specific lines were chosen from the line readings. In the hexagrams, broken lines were used as shorthand for the numbers 6 (六) and 8 (八), and solid lines were shorthand for values of 7 (七) and 9 (九). The Great Commentary contains a late classic description of a process where various numerological operations are performed on a bundle of 50 stalks, leaving remainders of 6 to 9.
大衍之数五十,其用四十有九。分而为二以象两,挂一以象三,揲之以四以象四时,归奇于扐以象闰。五岁再闰,故再扐而后挂。天一,地二;天三,地四;天五,地六;天七,地八;天九,地十。天数五,地数五。五位相得而各有合,天数二十有五,地数三十,凡天地之数五十有五,此所以成变化而行鬼神也。乾之策二百一十有六,坤之策百四十有四,凡三百六十,当期之日。二篇之策,万有一千五百二十,当万物之数也。是故四营而成《易》,十有八变而成卦,八卦而小成。引而伸之,触类而长之,天下之能事毕矣。显道神德行,是故可与酬酢,可与祐神矣。子曰:“知变化之道者,其知神之所为乎。”
# Install
```python
pip install iching
```
# A Quick Tutorial
```python
from iching import iching
def ichingbook(birthday):
iching.ichingDate(birthday)
fixPred, changePred = iching.getPredict()
iching.plotTransition(6, w = 15)
guaNames = iching.ichingName(fixPred, changePred)
fixText = iching.ichingText(fixPred, iching)
if changePred:
changeText = iching.ichingText(changePred, iching)
else:
changeText = None
sepline1 = '\n __/\__ '
sepline2 = '\n __|BOOK|__ '
sepline3 = '\n ___/_ICHING_\___ '
sepline4 = '\n |-||||||||-| '
sepline5 = '\n _/\___/\___/\__|-|/\/\/\|-|__/\___/\___/\_'
sepline6 = '\n ||___||___||__|-||||||||-|__||___||___|| '
print(guaNames+'\n'+u'本卦: '+fixText+sepline1+sepline2+sepline3+sepline4+sepline5+sepline6+'\n\n\n'+u'变卦: '+changeText)
ichingbook(1985092720180119)
```
# Use
```python
from iching import iching
```
##### 0. Set iching time
```python
iching.ichingDate(1985052620150704)
# e.g., 19850526 is your birthday and 20150704 is the prediction time.
# of course, your can also input more precise time.
```
##### 1. Start to predict
```python
iching.getPredict()
```
##### 2. Get the iching name
```python
fixPred, changePred = iching.getPredict()
iching.ichingName(fixPred, changePred )
```
##### 3. Get the iching text
```python
iching.ichingText(fixPred, iching)
```
坎卦原文坎。习坎,有孚,维心亨,行有尚。象曰:水洊至,习坎。君子以常德行,习教事。白话文解释习坎卦:抓获俘虏,劝慰安抚他们,通泰。途中将得到帮助。《象辞》说:坎为永,水长流不滞,是坎卦的卦象。君子观此卦象,从而尊尚德行,取法于细水长流之象,学习教化人民的方法。
《断易天机》解坎卦坎上坎下,为坎宫本位卦。坎为陷入、陷阱,为险难之境。此时应坚持信心,才能豁然贯通。
北宋易学家邵雍解艰难危险,重险重陷;事多困阻,谨慎行事。得此卦者,运气不佳,多难危险,事多困阻,宜谨言慎行,退守保安。
##### 4. Understand Three Changes
```python
data = 50 - 1
sky, earth, firstChange, data = iching.getChange(data)
print sky, '\n', earth, '\n',firstChange, '\n', data
sky, earth, secondChange, data = iching.getChange(data)
print sky, '\n', earth, '\n',secondChange, '\n', data
sky, earth, thirdChange, data = iching.getChange(data)
print sky, '\n', earth, '\n',thirdChange, '\n', data
```
##### 5. Plot transitions
```pytnon
%matplotlib inline
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(15, 10),facecolor='white')
plt.subplot(2, 2, 1)
iching.plotTransitionRemainder(1000, w = 50)
plt.subplot(2, 2, 2)
iching.plotTransitionRemainder(1000, w = 50)
plt.subplot(2, 2, 3)
iching.plotTransitionRemainder(1000, w = 50)
plt.subplot(2, 2, 4)
iching.plotTransitionRemainder(1000, w = 50)
```
![](http://7lrzgn.com1.z0.glb.clouddn.com/download.png)
没有合适的资源?快使用搜索试试~ 我知道了~
iching:A python package of I Ching 《易经》蓍草卦的Python版本
共197个文件
js:86个
text:64个
py:8个
需积分: 37 4 下载量 15 浏览量
2021-05-15
05:41:45
上传
评论 2
收藏 3.03MB ZIP 举报
温馨提示
I Ching Python项目 iching是王成军开发的一种工具包。 它采用时草预测的方法来重现《易经》的预测-《易经》。 《易经》,又称《易经》或《易经》,是一种古老的占卜文字,也是最古老的中国经典。 周易提供了使用used草植物茎秆进行区分的指南,但不知道the草茎杆如何变成数字,或者如何从品系读数中选择特定品系。 在卦中,虚线用作数字6(六)和8(八)的简写,而实线则是数值7(七)和9(九)的简写。 《伟大的评论》(Great Commentary)包含了一个过程的后期经典描述,该过程中对50根茎进行捆绑,进行各种数字操作,剩下6到9个余数。 大衍之数五十,其用四十有九。分而为二以象两,挂一以象三,揲之以四以象四时,归奇于扐以象闰。五岁再闰,天一,地二;天三,地四;天五,地六;天七,地八;天九,地十。天数五,地数五。五位相得而各有合,天数二十有五,地数三十,凡天地之数五十有五
资源详情
资源评论
资源推荐
收起资源包目录
iching:A python package of I Ching 《易经》蓍草卦的Python版本 (197个子文件)
setup.cfg 253B
style.min.css 185KB
jquery-ui.min.css 26KB
bootstrap-tour.min.css 2KB
override.css 325B
custom.css 144B
package_data.dat 1.12MB
package_data.dat 576KB
package_data.dat 576KB
package_data.dat 576KB
data_file 9B
iching-3.4.0.tar.gz 207KB
index.html 96KB
MANIFEST.in 241B
iching.ipynb 179KB
iching-checkpoint.ipynb 179KB
iching_intro.ipynb 132KB
iching_intro-checkpoint.ipynb 121KB
iching_today.ipynb 72KB
iching_today-checkpoint.ipynb 72KB
440px-I_Ching_Song_Dynasty_print.jpg 88KB
440px-Yarrow_stalks_for_I_Ching.JPG 53KB
codemirror.js 313KB
jquery-ui.min.js 223KB
moment.js 94KB
notebook.js 84KB
jquery.min.js 82KB
require.js 81KB
html-css-sanitizer-minified.js 71KB
encoding.js 68KB
MathJax.js 59KB
kernel.js 36KB
bootstrap.min.js 35KB
outputarea.js 32KB
utils.js 30KB
widget.js 29KB
marked.js 27KB
bootstrap-tour.min.js 25KB
markdown.js 23KB
codecell.js 22KB
widget_selection.js 22KB
cell.js 22KB
manager.js 19KB
backbone-min.js 19KB
widget_int.js 19KB
actions.js 17KB
celltoolbar.js 16KB
keyboard.js 16KB
menubar.js 15KB
completer.js 14KB
underscore-min.js 14KB
notificationarea.js 14KB
python.js 13KB
kernelselector.js 12KB
xml.js 12KB
widget_selectioncontainer.js 12KB
textcell.js 12KB
tooltip.js 11KB
meta.js 11KB
quickhelp.js 10KB
session.js 10KB
mathjaxutils.js 10KB
widget_string.js 9KB
keyboardmanager.js 8KB
savewidget.js 8KB
comment.js 8KB
contents.js 8KB
tour.js 7KB
scrollmanager.js 7KB
dialog.js 7KB
comm.js 7KB
stex.js 7KB
closebrackets.js 6KB
maintoolbar.js 6KB
notificationwidget.js 6KB
pager.js 5KB
widget_box.js 5KB
widget_bool.js 5KB
toolbar.js 5KB
matchbrackets.js 5KB
main.js 5KB
promise.min.js 5KB
multiplex.js 4KB
serialize.js 4KB
security.js 4KB
config.js 4KB
gfm.js 4KB
widget_link.js 3KB
contexthint.js 3KB
overlay.js 3KB
rawcell.js 3KB
notificationarea(1).js 3KB
runmode.js 2KB
widget_button.js 2KB
codemirror-ipythongfm.js 2KB
widget_output.js 2KB
page.js 2KB
custom.js 2KB
slideshow.js 2KB
about.js 2KB
共 197 条
- 1
- 2
蒙霄阳
- 粉丝: 21
- 资源: 4572
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python代码案例详解-旅行商问题的多种求解算法.zip
- springcloud.rar
- 一键清理maven项目依赖下载失败生成的.lastUpdated文件, 以及解决无法连接远程仓库导致本地依赖找不到的批处理脚本
- C#+WPF开发IOC框架实战架构师课程
- 《JAVA WEB项目开发案例精粹》中的代码案例源文件(超全).rar
- 背景music,用作业网轮地址
- comment_6e56cd5d6e140046ef1cd248910ea5ca.png
- 基于卷积神经网络的自动驾驶系统的设计与实现
- MySQL的执行原理-2.md
- 基于 FCN 网络对无人机俯拍下的生活场景语义分割(12类别)【包含数据集、完整代码、训练好的结果、权重文件等等】
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0