Markov Analysis Help

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat May 17 08:01:01 EDT 2008


dave, few general comments to your code:
- Instead of using a comment that explains the meaning of a function,
add such things into docstrings.
- Your names can be improved, instead of f you can use file_name or
something like that, instead of convert_file you can use a name that
denotes that the conversion is already done, etc.
- You can use xrange instead of range and you can indent less, like 4
spaces.
- This line may be slow, you may want to find simpler ways to do the
same thing:
rkey = random.choice(analyze.keys())
- I suggest you to add doctests to all your functions.

Bye,
bearophile



More information about the Python-list mailing list