{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"
"
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"| 11 | 12 | 13 | 14 |
| 21 | 22 | 23 | |
| not an Array |
| 31 | 32 | 33 | 34 |
"
],
"text/plain": [
"\"| 11 | 12 | 13 | 14 |
| 21 | 22 | 23 | |
| not an Array |
| 31 | 32 | 33 | 34 |
\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"| a | b | c |
|---|
| 11 | 21 | 31 |
| 12 | 22 | 32 |
| 13 | 23 | 33 |
| 14 | | 34 |
"
],
"text/plain": [
"\"| a | b | c |
|---|
| 11 | 21 | 31 |
| 12 | 22 | 32 |
| 13 | 23 | 33 |
| 14 | | 34 |
\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"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": [
"| 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 993 | 994 | 995 | 996 | 997 | 998 | 999 |
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 1986 | 1988 | 1990 | 1992 | 1994 | 1996 | 1998 |
| 3 | 6 | 9 | 12 | 15 | 18 | 21 | 2979 | 2982 | 2985 | 2988 | 2991 | 2994 | 2997 |
| 4 | 8 | 12 | 16 | 20 | 24 | 28 | 3972 | 3976 | 3980 | 3984 | 3988 | 3992 | 3996 |
| 5 | 10 | 15 | 20 | 25 | 30 | 35 | 4965 | 4970 | 4975 | 4980 | 4985 | 4990 | 4995 |
| 6 | 12 | 18 | 24 | 30 | 36 | 42 | 5958 | 5964 | 5970 | 5976 | 5982 | 5988 | 5994 |
| 7 | 14 | 21 | 28 | 35 | 42 | 49 | 6951 | 6958 | 6965 | 6972 | 6979 | 6986 | 6993 |
| ⋮ | ⋱ | ⋮ |
| 993 | 1986 | 2979 | 3972 | 4965 | 5958 | 6951 | … | 986049 | 987042 | 988035 | 989028 | 990021 | 991014 | 992007 |
| 994 | 1988 | 2982 | 3976 | 4970 | 5964 | 6958 | 987042 | 988036 | 989030 | 990024 | 991018 | 992012 | 993006 |
| 995 | 1990 | 2985 | 3980 | 4975 | 5970 | 6965 | 988035 | 989030 | 990025 | 991020 | 992015 | 993010 | 994005 |
| 996 | 1992 | 2988 | 3984 | 4980 | 5976 | 6972 | 989028 | 990024 | 991020 | 992016 | 993012 | 994008 | 995004 |
| 997 | 1994 | 2991 | 3988 | 4985 | 5982 | 6979 | 990021 | 991018 | 992015 | 993012 | 994009 | 995006 | 996003 |
| 998 | 1996 | 2994 | 3992 | 4990 | 5988 | 6986 | 991014 | 992012 | 993010 | 994008 | 995006 | 996004 | 997002 |
| 999 | 1998 | 2997 | 3996 | 4995 | 5994 | 6993 | 992007 | 993006 | 994005 | 995004 | 996003 | 997002 | 998001 |
"
],
"text/plain": [
"\"| 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 993 | 994 | 995 | 996 | 997 | 998 | 999 |
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 1986 | 1988 | 1990 | 1992 | 1994 | 1996 | 1998 |
| 3 | 6 | 9 | 12 | 15 | 18 | 21 | 2979 | 2982 | 2985 | 2988 | 2991 | 2994 | 2997 |
| 4 | 8 | 12 | 16 | 20 | 24 | 28 | 3972 | 3976 | 3980 | 3984 | 3988 | 3992 | 3996 |
| 5 | 10 | 15 | 20 | 25 | 30 | 35 | 4965 | 4970 | 4975 | 4980 | 4985 | 4990 | 4995 |
| 6 | 12 | 18 | 24 | 30 | 36 | 42 | 5958 | 5964 | 5970 | 5976 | 5982 | 5988 | 5994 |
| 7 | 14 | 21 | 28 | 35 | 42 | 49 | 6951 | 6958 | 6965 | 6972 | 6979 | 6986 | 6993 |
| ⋮ | ⋱ | ⋮ |
| 993 | 1986 | 2979 | 3972 | 4965 | 5958 | 6951 | … | 986049 | 987042 | 988035 | 989028 | 990021 | 991014 | 992007 |
| 994 | 1988 | 2982 | 3976 | 4970 | 5964 | 6958 | 987042 | 988036 | 989030 | 990024 | 991018 | 992012 | 993006 |
| 995 | 1990 | 2985 | 3980 | 4975 | 5970 | 6965 | 988035 | 989030 | 990025 | 991020 | 992015 | 993010 | 994005 |
| 996 | 1992 | 2988 | 3984 | 4980 | 5976 | 6972 | 989028 | 990024 | 991020 | 992016 | 993012 | 994008 | 995004 |
| 997 | 1994 | 2991 | 3988 | 4985 | 5982 | 6979 | 990021 | 991018 | 992015 | 993012 | 994009 | 995006 | 996003 |
| 998 | 1996 | 2994 | 3992 | 4990 | 5988 | 6986 | 991014 | 992012 | 993010 | 994008 | 995006 | 996004 | 997002 |
| 999 | 1998 | 2997 | 3996 | 4995 | 5994 | 6993 | 992007 | 993006 | 994005 | 995004 | 996003 | 997002 | 998001 |
\""
]
},
"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": [
"| 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 993 | 994 | 995 | 996 | 997 | 998 | 999 |
|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 993 | 994 | 995 | 996 | 997 | 998 | 999 |
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 1986 | 1988 | 1990 | 1992 | 1994 | 1996 | 1998 |
| 3 | 6 | 9 | 12 | 15 | 18 | 21 | 2979 | 2982 | 2985 | 2988 | 2991 | 2994 | 2997 |
| 4 | 8 | 12 | 16 | 20 | 24 | 28 | 3972 | 3976 | 3980 | 3984 | 3988 | 3992 | 3996 |
| 5 | 10 | 15 | 20 | 25 | 30 | 35 | 4965 | 4970 | 4975 | 4980 | 4985 | 4990 | 4995 |
| 6 | 12 | 18 | 24 | 30 | 36 | 42 | 5958 | 5964 | 5970 | 5976 | 5982 | 5988 | 5994 |
| 7 | 14 | 21 | 28 | 35 | 42 | 49 | 6951 | 6958 | 6965 | 6972 | 6979 | 6986 | 6993 |
| ⋮ | ⋱ | ⋮ |
| 993 | 1986 | 2979 | 3972 | 4965 | 5958 | 6951 | … | 986049 | 987042 | 988035 | 989028 | 990021 | 991014 | 992007 |
| 994 | 1988 | 2982 | 3976 | 4970 | 5964 | 6958 | 987042 | 988036 | 989030 | 990024 | 991018 | 992012 | 993006 |
| 995 | 1990 | 2985 | 3980 | 4975 | 5970 | 6965 | 988035 | 989030 | 990025 | 991020 | 992015 | 993010 | 994005 |
| 996 | 1992 | 2988 | 3984 | 4980 | 5976 | 6972 | 989028 | 990024 | 991020 | 992016 | 993012 | 994008 | 995004 |
| 997 | 1994 | 2991 | 3988 | 4985 | 5982 | 6979 | 990021 | 991018 | 992015 | 993012 | 994009 | 995006 | 996003 |
| 998 | 1996 | 2994 | 3992 | 4990 | 5988 | 6986 | 991014 | 992012 | 993010 | 994008 | 995006 | 996004 | 997002 |
| 999 | 1998 | 2997 | 3996 | 4995 | 5994 | 6993 | 992007 | 993006 | 994005 | 995004 | 996003 | 997002 | 998001 |
"
],
"text/plain": [
"\"| 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 993 | 994 | 995 | 996 | 997 | 998 | 999 |
|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 993 | 994 | 995 | 996 | 997 | 998 | 999 |
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 1986 | 1988 | 1990 | 1992 | 1994 | 1996 | 1998 |
| 3 | 6 | 9 | 12 | 15 | 18 | 21 | 2979 | 2982 | 2985 | 2988 | 2991 | 2994 | 2997 |
| 4 | 8 | 12 | 16 | 20 | 24 | 28 | 3972 | 3976 | 3980 | 3984 | 3988 | 3992 | 3996 |
| 5 | 10 | 15 | 20 | 25 | 30 | 35 | 4965 | 4970 | 4975 | 4980 | 4985 | 4990 | 4995 |
| 6 | 12 | 18 | 24 | 30 | 36 | 42 | 5958 | 5964 | 5970 | 5976 | 5982 | 5988 | 5994 |
| 7 | 14 | 21 | 28 | 35 | 42 | 49 | 6951 | 6958 | 6965 | 6972 | 6979 | 6986 | 6993 |
| ⋮ | ⋱ | ⋮ |
| 993 | 1986 | 2979 | 3972 | 4965 | 5958 | 6951 | … | 986049 | 987042 | 988035 | 989028 | 990021 | 991014 | 992007 |
| 994 | 1988 | 2982 | 3976 | 4970 | 5964 | 6958 | 987042 | 988036 | 989030 | 990024 | 991018 | 992012 | 993006 |
| 995 | 1990 | 2985 | 3980 | 4975 | 5970 | 6965 | 988035 | 989030 | 990025 | 991020 | 992015 | 993010 | 994005 |
| 996 | 1992 | 2988 | 3984 | 4980 | 5976 | 6972 | 989028 | 990024 | 991020 | 992016 | 993012 | 994008 | 995004 |
| 997 | 1994 | 2991 | 3988 | 4985 | 5982 | 6979 | 990021 | 991018 | 992015 | 993012 | 994009 | 995006 | 996003 |
| 998 | 1996 | 2994 | 3992 | 4990 | 5988 | 6986 | 991014 | 992012 | 993010 | 994008 | 995006 | 996004 | 997002 |
| 999 | 1998 | 2997 | 3996 | 4995 | 5994 | 6993 | 992007 | 993006 | 994005 | 995004 | 996003 | 997002 | 998001 |
\""
]
},
"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": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"\"\""
]
},
"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": [
""
],
"text/plain": [
"\"\""
]
},
"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
}