3 ms·
Probably. % gem install rubypython % wget http://thinkstats.com/Pmf.py % irb >> require 'rubypython' => true >> RubyPython.start => true >> sy
by halostatue 16y ago
Probably.
% 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#toc11 http://www.greenteapress.com/thinkstats/html/book003.html#to...).