Markov chains in pure python
Project description
About
marc is a "proof-of-concept" package that demonstrates the possibility of building Markov chains in pure python.
Usage
from marc import MarkovChain
chain = [
'Rock', 'Rock', 'Paper', 'Rock', 'Scissors',
'Paper', 'Paper', 'Paper', 'Scissors', 'Rock',
'Scissors', 'Scissors', 'Paper', 'Rock', 'Rock',
'Rock', 'Rock', 'Paper', 'Rock', 'Rock'
]
mc = MarkovChain(chain)
mc.next_state('Rock')
# 'Rock'
mc.generate_states('Paper', n=5)
# ['Scissors', 'Paper', 'Rock', 'Paper', 'Scissors']
mc.next_state('Scissors')
# 'Paper'
Install
pip install marc
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
marc-1.0.1.tar.gz
(2.4 kB
view hashes)