{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
1
2
3
" ], "text/plain": [ "\"
1
2
3
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
1
2
123
23
" ], "text/plain": [ "\"
1
2
123
23
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
abc
123
" ], "text/plain": [ "\"
abc
123
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
11121314
212223
not an Array
31323334
" ], "text/plain": [ "\"
11121314
212223
not an Array
31323334
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
abc
112131
122232
132333
1434
" ], "text/plain": [ "\"
abc
112131
122232
132333
1434
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
abce
123
not an Array
2345
" ], "text/plain": [ "\"
abce
123
not an Array
2345
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
abc0d12
1230
2345
xy
abc
" ], "text/plain": [ "\"
abc0d12
1230
2345
xy
abc
\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "IRuby.display IRuby.table([1,2,[],3])\n", "IRuby.display IRuby.table([1,2,[1,2,3],[2,3]])\n", "IRuby.display IRuby.table({a:1,b:2,c:3})\n", "IRuby.display IRuby.table([[11,12,13,14],[21,22,23],'not an Array',[31,32,33,34]])\n", "IRuby.display IRuby.table({a:[11,12,13,14],b:[21,22,23],c:[31,32,33,34]})\n", "IRuby.display IRuby.table([{a:1,b:2,c:3},'not an Array',{a:2,b:3,c:4,e:5}])\n", "IRuby.display IRuby.table([{a:1,b:2,c:3, 0 => 0},{a:2,b:3,c:4,d:5},{0=>:x,1=>:y},[:a,:b,:c]])" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
1234567993994995996997998999
24681012141986198819901992199419961998
369121518212979298229852988299129942997
4812162024283972397639803984398839923996
51015202530354965497049754980498549904995
61218243036425958596459705976598259885994
71421283542496951695869656972697969866993
993198629793972496559586951986049987042988035989028990021991014992007
994198829823976497059646958987042988036989030990024991018992012993006
995199029853980497559706965988035989030990025991020992015993010994005
996199229883984498059766972989028990024991020992016993012994008995004
997199429913988498559826979990021991018992015993012994009995006996003
998199629943992499059886986991014992012993010994008995006996004997002
999199829973996499559946993992007993006994005995004996003997002998001
" ], "text/plain": [ "\"
1234567993994995996997998999
24681012141986198819901992199419961998
369121518212979298229852988299129942997
4812162024283972397639803984398839923996
51015202530354965497049754980498549904995
61218243036425958596459705976598259885994
71421283542496951695869656972697969866993
993198629793972496559586951986049987042988035989028990021991014992007
994198829823976497059646958987042988036989030990024991018992012993006
995199029853980497559706965988035989030990025991020992015993010994005
996199229883984498059766972989028990024991020992016993012994008995004
997199429913988498559826979990021991018992015993012994009995006996003
998199629943992499059886986991014992012993010994008995006996004997002
999199829973996499559946993992007993006994005995004996003997002998001
\"" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "IRuby.table (1..1000).map {|i| (1..1000).map {|j| i * j } }" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
1234567993994995996997998999
1234567993994995996997998999
24681012141986198819901992199419961998
369121518212979298229852988299129942997
4812162024283972397639803984398839923996
51015202530354965497049754980498549904995
61218243036425958596459705976598259885994
71421283542496951695869656972697969866993
993198629793972496559586951986049987042988035989028990021991014992007
994198829823976497059646958987042988036989030990024991018992012993006
995199029853980497559706965988035989030990025991020992015993010994005
996199229883984498059766972989028990024991020992016993012994008995004
997199429913988498559826979990021991018992015993012994009995006996003
998199629943992499059886986991014992012993010994008995006996004997002
999199829973996499559946993992007993006994005995004996003997002998001
" ], "text/plain": [ "\"
1234567993994995996997998999
1234567993994995996997998999
24681012141986198819901992199419961998
369121518212979298229852988299129942997
4812162024283972397639803984398839923996
51015202530354965497049754980498549904995
61218243036425958596459705976598259885994
71421283542496951695869656972697969866993
993198629793972496559586951986049987042988035989028990021991014992007
994198829823976497059646958987042988036989030990024991018992012993006
995199029853980497559706965988035989030990025991020992015993010994005
996199229883984498059766972989028990024991020992016993012994008995004
997199429913988498559826979990021991018992015993012994009995006996003
998199629943992499059886986991014992012993010994008995006996004997002
999199829973996499559946993992007993006994005995004996003997002998001
\"" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "IRuby.table Hash[(1..1000).map {|i| [i, (1..1000).map {|j| i * j }] }]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
01
12
34
" ], "text/plain": [ "\"
01
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
12
34
" ], "text/plain": [ "\"
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
12
34
" ], "text/plain": [ "\"
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
ab
12
34
" ], "text/plain": [ "\"
ab
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
12
34
" ], "text/plain": [ "\"
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
ab
12
34
" ], "text/plain": [ "\"
ab
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
ab
12
34
" ], "text/plain": [ "\"
ab
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
12
34
" ], "text/plain": [ "\"
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
ab
12
34
" ], "text/plain": [ "\"
ab
12
34
\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "IRuby.display IRuby.table [[1,2],[3,4]], header: true\n", "IRuby.display IRuby.table [[1,2],[3,4]], header: false\n", "IRuby.display IRuby.table [[1,2],[3,4]]\n", "\n", "IRuby.display IRuby.table [{a:1,b:2},{a:3,b:4}], header: true\n", "IRuby.display IRuby.table [{a:1,b:2},{a:3,b:4}], header: false\n", "IRuby.display IRuby.table [{a:1,b:2},{a:3,b:4}]\n", "\n", "\n", "IRuby.display IRuby.table({a:[1,3],b:[2,4]}, header: true)\n", "IRuby.display IRuby.table({a:[1,3],b:[2,4]}, header: false)\n", "IRuby.display IRuby.table({a:[1,3],b:[2,4]})" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
abc
123
4
" ], "text/plain": [ "\"
abc
123
4
\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "IRuby.display IRuby.table({a:1,b:2,c:[3,4]})" ] } ], "metadata": { "kernelspec": { "display_name": "Ruby", "language": "ruby", "name": "ruby" }, "language_info": { "file_extension": "rb", "mimetype": "text/ruby", "name": "ruby", "version": "2.1.2" } }, "nbformat": 4, "nbformat_minor": 0 }