Can a ruby/JS hacker with no python experience jump into this book?
Can a ruby/JS hacker with no python experience jump into this book?
I went through the fist couple of chapters and all the python code I've seen so far is quite close to "pseudo-code" than deeply-idiomatic Python.
Considering the fact that the Prof. also wrote "How To Think Like a Computer Scientist: Learning with {Python/Java/C++}", you can be rest assured that he knows how not to trip up students with clever syntax.
I adopted Python because I was told Ruby is the dark side. oO
% gem install rubypython
% wget http://thinkstats.com/Pmf.py
% irb
>> require 'rubypython'
=> true
>> RubyPython.start
=> true
>> sys = RubyPython.import 'sys'
=> <module 'sys' (built-in)>
>> sys.path.append '.'
=> None
>> Pmf = RubyPython.import 'Pmf'
=> <module 'Pmf' from './Pmf.py'>
>> hist = Pmf.MakeHistFromList([1, 2, 2, 3, 5])
=> <Pmf.Hist object at 0x7f6681a4f490>
>> hist.Freq(2)
=> 2
>> hist.Freq(4)
=> 0
>> hist.Values()
=> [1, 2, 3, 5]
>> RubyPython.stop
=> true
The above adapted from part of section 2.4 (http://www.greenteapress.com/thinkstats/html/book003.html#to...).But let me know whether that turns out to be true.
Any chance we'll see a Clojure version of any of your books? It seems to be shaping up as a good choice for scientific computing.
Clojure looks interesting, but I don't know much about it, so I probably won't do anything with it soon. But part of the reason I use free licenses is so that other people can adapt my books.
Nicholas Monje is working on Think OCaml (http://thinkocaml.com); that might be the best version to translate into Clojure.