{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%use dataframe, khttp" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "// to see autogenerated code, uncomment the line below:\n", "//%trackExecution generated" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Get Data" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "val response = khttp.get(\"http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic.txt\")\n", "val cleanedText = response.text.replace(\"\\\"Molly\\\"\", \"Molly\").replace(\"row.names\", \"row\").replace(\"home.dest\", \"home\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "// convert data to dataframe, generate marker interface for typed data frame wrapper and extension properties for it\n", "val df = DataFrame.readDelim(cleanedText.byteInputStream())" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female
131st1Aubert, Mrs Leontine PaulinenullCherbourgParis, FranceB-3517477 L69 6s9female
141st1Barkworth, Mr Algernon H.nullSouthamptonHessle, YorksA-23Bmale
151st0Baumann, Mr John D.nullSouthamptonNew York, NYmale
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female

... only showing top 20 rows

" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Select" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "name [Str][1313]: Allen, Miss Elisabeth Walton, Allison, Miss Helen Loraine, Allison, Mr Hudson Josh..." ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// get typed column as extension property\n", "df.name" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
name
Allen, Miss Elisabeth Walton
Allison, Miss Helen Loraine
Allison, Mr Hudson Joshua Creighton
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)
Allison, Master Hudson Trevor
Anderson, Mr Harry
Andrews, Miss Kornelia Theodosia
Andrews, Mr Thomas, jr
Appleton, Mrs Edward Dale (Charlotte Lamson)
Artagaveytia, Mr Ramon
Astor, Colonel John Jacob
Astor, Mrs John Jacob (Madeleine Talmadge Force)
Aubert, Mrs Leontine Pauline
Barkworth, Mr Algernon H.
Baumann, Mr John D.
Baxter, Mrs James (Helene DeLaudeniere Chaput)
Baxter, Mr Quigg Edmond
Beattie, Mr Thomson
Beckwith, Mr Richard Leonard
Beckwith, Mrs Richard Leonard (Sallie Monypeny)

... only showing top 20 rows

" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// select single column -> returns DataFrame\n", "df.select{name}" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
nameageembarked
Allen, Miss Elisabeth Walton29.0Southampton
Allison, Miss Helen Loraine2.0Southampton
Allison, Mr Hudson Joshua Creighton30.0Southampton
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0Southampton
Allison, Master Hudson Trevor0.9167Southampton
Anderson, Mr Harry47.0Southampton
Andrews, Miss Kornelia Theodosia63.0Southampton
Andrews, Mr Thomas, jr39.0Southampton
Appleton, Mrs Edward Dale (Charlotte Lamson)58.0Southampton
Artagaveytia, Mr Ramon71.0Cherbourg
Astor, Colonel John Jacob47.0Cherbourg
Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0Cherbourg
Aubert, Mrs Leontine PaulinenullCherbourg
Barkworth, Mr Algernon H.nullSouthampton
Baumann, Mr John D.nullSouthampton
Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0Cherbourg
Baxter, Mr Quigg Edmond24.0Cherbourg
Beattie, Mr Thomson36.0Cherbourg
Beckwith, Mr Richard Leonard37.0Southampton
Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0Southampton

... only showing top 20 rows

" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// select several columns\n", "df.select{columns(name, age, embarked)}" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
nameagesex
Allen, Miss Elisabeth Walton29.0female
Allison, Miss Helen Loraine2.0female
Allison, Mr Hudson Joshua Creighton30.0male
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0female
Allison, Master Hudson Trevor0.9167male
Anderson, Mr Harry47.0male
Andrews, Miss Kornelia Theodosia63.0female
Andrews, Mr Thomas, jr39.0male
Appleton, Mrs Edward Dale (Charlotte Lamson)58.0female
Artagaveytia, Mr Ramon71.0male
Astor, Colonel John Jacob47.0male
Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0female
Aubert, Mrs Leontine Paulinenullfemale
Barkworth, Mr Algernon H.nullmale
Baumann, Mr John D.nullmale
Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0female
Baxter, Mr Quigg Edmond24.0male
Beattie, Mr Thomson36.0male
Beckwith, Mr Richard Leonard37.0male
Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0female

... only showing top 20 rows

" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// another way to select columns without compile-time check\n", "df.select(df.name, df.age, df.sex)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
pclassnameembarkedhomeroomticketboatsex
1stAllen, Miss Elisabeth WaltonSouthamptonSt Louis, MOB-524160 L2212female
1stAllison, Miss Helen LoraineSouthamptonMontreal, PQ / Chesterville, ONC26female
1stAllison, Mr Hudson Joshua CreightonSouthamptonMontreal, PQ / Chesterville, ONC26(135)male
1stAllison, Mrs Hudson J.C. (Bessie Waldo Daniels)SouthamptonMontreal, PQ / Chesterville, ONC26female
1stAllison, Master Hudson TrevorSouthamptonMontreal, PQ / Chesterville, ONC2211male
1stAnderson, Mr HarrySouthamptonNew York, NYE-123male
1stAndrews, Miss Kornelia TheodosiaSouthamptonHudson, NYD-713502 L7710female
1stAndrews, Mr Thomas, jrSouthamptonBelfast, NIA-36male
1stAppleton, Mrs Edward Dale (Charlotte Lamson)SouthamptonBayside, Queens, NYC-1012female
1stArtagaveytia, Mr RamonCherbourgMontevideo, Uruguay(22)male
1stAstor, Colonel John JacobCherbourgNew York, NY17754 L224 10s 6d(124)male
1stAstor, Mrs John Jacob (Madeleine Talmadge Force)CherbourgNew York, NY17754 L224 10s 6d4female
1stAubert, Mrs Leontine PaulineCherbourgParis, FranceB-3517477 L69 6s9female
1stBarkworth, Mr Algernon H.SouthamptonHessle, YorksA-23Bmale
1stBaumann, Mr John D.SouthamptonNew York, NYmale
1stBaxter, Mrs James (Helene DeLaudeniere Chaput)CherbourgMontreal, PQB-58/606female
1stBaxter, Mr Quigg EdmondCherbourgMontreal, PQB-58/60male
1stBeattie, Mr ThomsonCherbourgWinnipeg, MNC-6male
1stBeckwith, Mr Richard LeonardSouthamptonNew York, NYD-355male
1stBeckwith, Mrs Richard Leonard (Sallie Monypeny)SouthamptonNew York, NYD-355female

... only showing top 20 rows

" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// select columns filtered by predicate\n", "df.selectIf{valueClass == String::class}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Index" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Row indexing\n", "df[1]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Allen, Miss Elisabeth Walton" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Column indexing\n", "df.name[0]" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Allen, Miss Elisabeth Walton" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Same result\n", "df[0].name" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Filter" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female
131st1Aubert, Mrs Leontine PaulinenullCherbourgParis, FranceB-3517477 L69 6s9female
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female
241st1Bishop, Mrs Dickinson H. (Helen Walton)19.0CherbourgDowagiac, MIB-497female
281st1Bonnell, Miss Caroline30.0SouthamptonYoungstown, OHC-78female
291st1Bonnell, Miss Elizabeth58.0SouthamptonBirkdale, England Cleveland, OhioC-1038female
311st1Bowen, Miss Grace Scott45.0CherbourgCooperstown, NY4female
321st1Bowerman, Miss Elsie Edith22.0SouthamptonSt Leonards-on-Sea, England Ohio6female
371st1Brown, Mrs James Joseph (Margaret Molly Tobin)44.0CherbourgDenver, CO17610 L27 15s 5d6female
381st1Brown, Mrs John Murray (Caroline Lane Lamson)59.0SouthamptonBelmont, MAC-101Dfemale
391st1Bucknell, Mrs William Robert (Emma Eliza Ward)60.0CherbourgPhiladelphia, PA8female
421st1Candee, Mrs Edward (Helen Churchill Hungerford)53.0CherbourgWashington, DC6female
431st1Cardeza, Mrs James Warburton Martinez (Charlott...58.0CherbourgGermantown, Philadelphia, PAB-51/3/517755 L512 6s3female
491st1Carter, Mrs William Ernest (Lucile Polk)36.0SouthamptonBryn Mawr, PA4female

... only showing top 20 rows

" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// filter rows by predicate. Predicate receiver is of type TypedDataFrameRow<*> with generated extension properties\n", "df.filter {sex == \"female\"}" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Operator call corresponds to a dot-qualified call 'age.compareTo(50)' which is not allowed on a nullable receiver 'age'." ] } ], "source": [ "df.filter { age > 50 } // compilation error, because 'age' is a nullable property" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male

... only showing top 20 rows

" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// filter rows where 'age' is not null. \n", "val withAges = df.filterNotNull {age}\n", "withAges" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
291st1Bonnell, Miss Elizabeth58.0SouthamptonBirkdale, England Cleveland, OhioC-1038female
381st1Brown, Mrs John Murray (Caroline Lane Lamson)59.0SouthamptonBelmont, MAC-101Dfemale
391st1Bucknell, Mrs William Robert (Emma Eliza Ward)60.0CherbourgPhiladelphia, PA8female
421st1Candee, Mrs Edward (Helen Churchill Hungerford)53.0CherbourgWashington, DC6female
431st1Cardeza, Mrs James Warburton Martinez (Charlott...58.0CherbourgGermantown, Philadelphia, PAB-51/3/517755 L512 6s3female
681st1Compton, Mrs Alexander Taylor (Mary Eliza Inger...64.0CherbourgLakewood, NJ14female
711st1Cornell, Mrs Robert Clifford (Malvina Helen Lam...55.0SouthamptonNew York, NYC-1012female
731st0Crosby, Captain Edward Gifford70.0SouthamptonMilwaukee, WI(269)male
741st1Crosby, Mrs Edward Gifford (Catherine Elizabeth...69.0SouthamptonMilwaukee, WI5female
951st1Eustis, Miss Elizabeth Mussey53.0CherbourgBrookline, MA4female
1041st0Fortune, Mr Mark64.0SouthamptonWinnipeg, MBmale
1051st1Fortune, Mrs Mark (Mary McDougald)60.0SouthamptonWinnipeg, MB10female
1111st1Frolicher-Stehli, Mr Maxmillian60.0CherbourgZurich, Switzerland5male
1201st0Goldschmidt, Mr George B.71.0CherbourgNew York, NYmale
1211st1Gracie, Colonel Archibald IV54.0SouthamptonWashington, DCC-51113780 L28 10sBmale
1241st1Graham, Mrs William Thompson (Edith Junkins)58.0SouthamptonGreenwich, CTC-9117582 L153 9s 3d3female
1351st0Hays, Mr Charles Melville55.0SouthamptonMontreal, PQ(307)male

... only showing top 20 rows

" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// now filtration works\n", "withAges.filter {age > 50}" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
741st1Crosby, Mrs Edward Gifford (Catherine Elizabeth...69.0SouthamptonMilwaukee, WI5female
" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// find the oldest survived woman\n", "withAges.filter {survived == 1 && sex == \"female\"}.maxBy{age}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sort" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
5062nd0Mitchell, Mr Henry Michael71.0SouthamptonGuernsey / Montclair, NJ and/or Toledo, Ohiomale
1201st0Goldschmidt, Mr George B.71.0CherbourgNew York, NYmale
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
731st0Crosby, Captain Edward Gifford70.0SouthamptonMilwaukee, WI(269)male
741st1Crosby, Mrs Edward Gifford (Catherine Elizabeth...69.0SouthamptonMilwaukee, WI5female
2531st0Straus, Mr Isidor67.0SouthamptonNew York, NY17483 L221 15s 7d(96)male
7733rd0Dewan, Mr Frank65.0Queenstownmale
1801st0Millet, Mr Francis Davis65.0SouthamptonEast Bridgewater, MA(249)male
5102nd0Myles, Mr Thomas Francis64.0QueenstownCambridge, MAmale
2711st0Warren, Mr Frank Manley64.0CherbourgPortland, ORmale
1941st0Ostby, Mr Engelhart Cornelius64.0CherbourgProvidence, RI(234)male
1921st0Nicholson, Mr Arthur Ernest64.0SouthamptonIsle of Wight, England(263)male
1041st0Fortune, Mr Mark64.0SouthamptonWinnipeg, MBmale
681st1Compton, Mrs Alexander Taylor (Mary Eliza Inger...64.0CherbourgLakewood, NJ14female
2541st0Straus, Mrs Isidor (Ida Blun)63.0SouthamptonNew York, NY17483 L221 15s 7dfemale
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
2521st1Stone, Mrs George Nelson (Martha E.)62.0Cincinatti, OH6female
2471st0Stead, Mr William Thomas62.0SouthamptonWimbledon Park, London / Hayling Island, HantsC-89male
2691st0Van Derhoef, Mr Wyckoff61.0SouthamptonBrooklyn, NY(245)male
2551st0Sutton, Mr Frederick61.0SouthamptonHaddenfield, NJ(46)male

... only showing top 20 rows

" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// sort by single column\n", "withAges.sortedByDesc {age}" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
7643rd1Dean, Miss Elizabeth Gladys (Millvena)0.1667SouthamptonDevon, England Wichita, KS12female
7523rd0Danbom, Master Gilbert Sigvard Emanuel0.3333SouthamptonStanton, IAmale
6173rd1Aks, Master Philip0.8333SouthamptonLondon, England Norfolk, VA39209111male
3592nd1Caldwell, Master Alden Gates0.8333SouthamptonBangkok, Thailand / Roseville, IL13male
5452nd1Richards, Master George Sidney0.8333SouthamptonCornwall / Akron, OH4male
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
3402nd1Becker, Master Richard F.1.0SouthamptonGuntur, India / Benton Harbour, MI230136 L3911male
7633rd1Dean, Master Bertram Vere1.0SouthamptonDevon, England Wichita, KS12male
4262nd1Hamalainen, Master Viljo1.0SouthamptonDetroit, MImale
4792nd1LaRoche, Miss Louise1.0CherbourgParis / Haitifemale
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
6283rd0Andersson, Miss Ellis Anna Maria2.0SouthamptonSweden Winnipeg, MNfemale
4922nd1Mallet, Master Andre2.0CherbourgParis / Montreal, PQmale
5132nd1Navratil, Master Edmond Roger2.0SouthamptonNice, France230080 L26Dmale
5382nd1Quick, Miss Phyllis May2.0SouthamptonPlymouth, Devon / Detroit, MI11female
5862nd1Wells, Master Ralph Lester2.0SouthamptonCornwall / Akron, OHmale
6453rd1Aspland, Master Edvin Rojj Felix3.0SouthamptonSweden Worcester, MA4male
6583rd1Baclini, Miss Eugenie3.0CherbourgSyria New York, NYfemale
7383rd1Coutts, Master Neville3.0SouthamptonEngland Brooklyn, NY2male
4802nd1LaRoche, Miss Simonne3.0CherbourgParis / Haitifemale

... only showing top 20 rows

" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// sort by several columns\n", "withAges.sortedBy {columns(age, name)}" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
7643rd1Dean, Miss Elizabeth Gladys (Millvena)0.1667SouthamptonDevon, England Wichita, KS12female
7523rd0Danbom, Master Gilbert Sigvard Emanuel0.3333SouthamptonStanton, IAmale
6173rd1Aks, Master Philip0.8333SouthamptonLondon, England Norfolk, VA39209111male
3592nd1Caldwell, Master Alden Gates0.8333SouthamptonBangkok, Thailand / Roseville, IL13male
5452nd1Richards, Master George Sidney0.8333SouthamptonCornwall / Akron, OH4male
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
3402nd1Becker, Master Richard F.1.0SouthamptonGuntur, India / Benton Harbour, MI230136 L3911male
7633rd1Dean, Master Bertram Vere1.0SouthamptonDevon, England Wichita, KS12male
4262nd1Hamalainen, Master Viljo1.0SouthamptonDetroit, MImale
4792nd1LaRoche, Miss Louise1.0CherbourgParis / Haitifemale
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
6283rd0Andersson, Miss Ellis Anna Maria2.0SouthamptonSweden Winnipeg, MNfemale
4922nd1Mallet, Master Andre2.0CherbourgParis / Montreal, PQmale
5132nd1Navratil, Master Edmond Roger2.0SouthamptonNice, France230080 L26Dmale
5382nd1Quick, Miss Phyllis May2.0SouthamptonPlymouth, Devon / Detroit, MI11female
5862nd1Wells, Master Ralph Lester2.0SouthamptonCornwall / Akron, OHmale
6453rd1Aspland, Master Edvin Rojj Felix3.0SouthamptonSweden Worcester, MA4male
6583rd1Baclini, Miss Eugenie3.0CherbourgSyria New York, NYfemale
7383rd1Coutts, Master Neville3.0SouthamptonEngland Brooklyn, NY2male
4802nd1LaRoche, Miss Simonne3.0CherbourgParis / Haitifemale

... only showing top 20 rows

" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// another way\n", "withAges.sortedBy(withAges.age, withAges.name)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Add Columns" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsexyear
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female1883.0
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female1910.0
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male1882.0
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female1887.0
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male1911.0833
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male1865.0
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female1849.0
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male1873.0
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female1854.0
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male1841.0
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male1865.0
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female1893.0
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female1862.0
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male1888.0
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male1876.0
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male1875.0
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female1865.0
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male1886.0
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male1887.0
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male1887.0

... only showing top 20 rows

" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// add new column and store result in a new field\n", "val withYear = withAges.add(\"year\") {1912 - age}\n", "withYear" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "year [Dbl][633]: 1883, 1910, 1882, 1887, 1911.083, 1865, 1849, 1873, 1854, 1841, 1865, 1893, 1862, 1..." ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// check new column\n", "withYear.year" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsexyeardied
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female1883.0false
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female1910.0true
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male1882.0true
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female1887.0true
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male1911.0833false
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male1865.0false
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female1849.0false
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male1873.0true
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female1854.0false
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male1841.0true
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male1865.0true
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female1893.0false
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female1862.0false
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male1888.0true
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male1876.0true
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male1875.0false
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female1865.0false
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male1886.0false
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male1887.0true
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male1887.0false

... only showing top 20 rows

" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// add several columns\n", "withAges.add {\n", " \"year\" {1912-age}\n", " \"died\" {survived == 0}\n", "}" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsexyeardied
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female1883.0false
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female1910.0true
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male1882.0true
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female1887.0true
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male1911.0833false
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male1865.0false
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female1849.0false
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male1873.0true
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female1854.0false
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male1841.0true
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male1865.0true
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female1893.0false
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female1862.0false
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male1888.0true
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male1876.0true
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male1875.0false
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female1865.0false
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male1886.0false
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male1887.0true
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male1887.0false

... only showing top 20 rows

" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// plus is overloaded for adding columns\n", "withAges + {\n", " \"year\" {1912-age}\n", " \"died\" {survived == 0}\n", "}" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "// another way to build new column via column arithmetics\n", "val birthYear = withAges.age * (-1) + 1912" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsexyear
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female1883.0
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female1910.0
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male1882.0
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female1887.0
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male1911.0833
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male1865.0
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female1849.0
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male1873.0
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female1854.0
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male1841.0
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male1865.0
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female1893.0
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female1862.0
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male1888.0
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male1876.0
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male1875.0
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female1865.0
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male1886.0
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male1887.0
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male1887.0

... only showing top 20 rows

" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// new column can be added to dataframe with '+' operator\n", "withAges + birthYear.rename(\"year\")" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsexrow duplicatepclass duplicatesurvived duplicatename duplicateage duplicateembarked duplicatehome duplicateroom duplicateticket duplicateboat duplicatesex duplicate
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485male
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)male
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497male

... only showing top 20 rows

" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Iterable of columns can also be added with '+' \n", "withAges + withAges.columns.map {it.rename(it.name + \" duplicate\")}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Remove columns" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomboatsex
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-52female
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-710female
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY(124)male
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY4female
131st1Aubert, Mrs Leontine PaulinenullCherbourgParis, FranceB-359female
141st1Barkworth, Mr Algernon H.nullSouthamptonHessle, YorksA-23Bmale
151st0Baumann, Mr John D.nullSouthamptonNew York, NYmale
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female

... only showing top 20 rows

" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// remove single column\n", "df.remove{ticket}" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
nameageembarkedhomeboatsex
Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MO2female
Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONfemale
Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ON(135)male
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONfemale
Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ON11male
Anderson, Mr Harry47.0SouthamptonNew York, NY3male
Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NY10female
Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NImale
Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NY2female
Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
Astor, Colonel John Jacob47.0CherbourgNew York, NY(124)male
Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY4female
Aubert, Mrs Leontine PaulinenullCherbourgParis, France9female
Barkworth, Mr Algernon H.nullSouthamptonHessle, YorksBmale
Baumann, Mr John D.nullSouthamptonNew York, NYmale
Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQ6female
Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQmale
Beattie, Mr Thomson36.0CherbourgWinnipeg, MNmale
Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NY5male
Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NY5female

... only showing top 20 rows

" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// remove several columns\n", "df.remove {columns(row, pclass, ticket, room, survived)}" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
survivednameageembarkedhomeroomticketboatsex
1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212female
0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26female
0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)male
0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26female
1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211male
1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123male
1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36male
1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male
1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female
1Aubert, Mrs Leontine PaulinenullCherbourgParis, FranceB-3517477 L69 6s9female
1Barkworth, Mr Algernon H.nullSouthamptonHessle, YorksA-23Bmale
0Baumann, Mr John D.nullSouthamptonNew York, NYmale
1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606female
0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60male
0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6male
1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355male
1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355female

... only showing top 20 rows

" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// remove several columns by column instances\n", "df.remove(df.row, df.pclass)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
survivednameageembarkedhometicketboatsex
1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MO24160 L2212female
0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONfemale
0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ON(135)male
0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONfemale
1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ON11male
1Anderson, Mr Harry47.0SouthamptonNew York, NY3male
1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NY13502 L7710female
0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NImale
1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NY2female
0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)male
1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4female
1Aubert, Mrs Leontine PaulinenullCherbourgParis, France17477 L69 6s9female
1Barkworth, Mr Algernon H.nullSouthamptonHessle, YorksBmale
0Baumann, Mr John D.nullSouthamptonNew York, NYmale
1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQ6female
0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQmale
0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNmale
1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NY5male
1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NY5female

... only showing top 20 rows

" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// '-' operator can also be used for removing columns\n", "df - {row} - {pclass} - {room}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Group" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
embarkedn
Southampton573
Cherbourg203
492
Queenstown45
" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// group by single column\n", "df.groupBy{ embarked }.count()" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
sexsurvivedn
female1307
female0156
male0708
male1142
" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// group by several columns\n", "df.groupBy{ columns(sex, survived) }.count()" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
sexsurvivedn
female1307
female0156
male0708
male1142
" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// another way\n", "df.groupBy(df.sex, df.survived).count()" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
embarkedtotal countsurvival rateaverage agemedian ageyoungestyoungest ageoldestoldest age
Southampton46339.74082073434125629.85727127429805719.0Dean, Miss Elizabeth Gladys (Millvena)0.1667Mitchell, Mr Henry Michael71.0
Cherbourg13360.90225563909774635.601503759398522.0LaRoche, Miss Louise1.0Artagaveytia, Mr Ramon71.0
Queenstown3138.7096774193548429.03225806451612837.0Carr, Miss Helen16.0Dewan, Mr Frank65.0
666.6666666666666647.83333333333333647.5Ovies y Rodriguez, Mr Servando28.0Stone, Mrs George Nelson (Martha E.)62.0
" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Various summarization operations on grouped data frame\n", "withAges.groupBy{ embarked }.summarize {\n", " \n", " \"total count\" { size } // lamba expressions are computed for every group. Type of receiver: TypedDataFrame<*>\n", " \"survival rate\" { count { survived == 1 }.toDouble() / size * 100 }\n", " \n", " \"average age\" { age.mean() } // column operations are also supported\n", " \"median age\" { age.median() }\n", " \n", " val youngest = find { minBy {age}!! } // 'find' builds data frame, collecting one row for every group\n", " \"youngest\" (youngest.name) // columns of collected data frame are passed in round parenthesis '()'\n", " \"youngest age\" (youngest.age)\n", " \n", " val oldest = find { maxBy {age}!! }\n", " \"oldest\" (oldest.name)\n", " \"oldest age\" (oldest.age)\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Misc" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1313" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.size" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "68" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "withAges.count {age > 50 }" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
7643rd1Dean, Miss Elizabeth Gladys (Millvena)0.1667SouthamptonDevon, England Wichita, KS12female
7523rd0Danbom, Master Gilbert Sigvard Emanuel0.3333SouthamptonStanton, IAmale
3592nd1Caldwell, Master Alden Gates0.8333SouthamptonBangkok, Thailand / Roseville, IL13male
5452nd1Richards, Master George Sidney0.8333SouthamptonCornwall / Akron, OH4male
6173rd1Aks, Master Philip0.8333SouthamptonLondon, England Norfolk, VA39209111male
" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "withAges.sortedBy{age}.take(5)" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
741st1Crosby, Mrs Edward Gifford (Catherine Elizabeth...69.0SouthamptonMilwaukee, WI5female
731st0Crosby, Captain Edward Gifford70.0SouthamptonMilwaukee, WI(269)male
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
1201st0Goldschmidt, Mr George B.71.0CherbourgNew York, NYmale
5062nd0Mitchell, Mr Henry Michael71.0SouthamptonGuernsey / Montclair, NJ and/or Toledo, Ohiomale
" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "withAges.sortedBy{age}.takeLast(5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## List <-> DataFrame conversion" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[Allen, Miss Elisabeth Walton, Allison, Miss Helen Loraine, Allison, Mr Hudson Joshua Creighton, Allison, Mrs Hudson J.C. (Bessie Waldo Daniels), Allison, Master Hudson Trevor]" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// 'rows' field is Iterable> so it can be used in any stdlib extensions for Iterable\n", "df.rows.map {it.name}.take(5)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
firstsecond
12.0
23.0
34.0
" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Sample List\n", "data class Item(val first: Int, val second: Double)\n", "val itemsList = listOf(Item(1,2.0), Item(2, 3.0), Item(3, 4.0))\n", "\n", "// List -> DataFrame by reflection\n", "itemsList.toDataFrame()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
abc
12.02.0
23.06.0
34.012.0
" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// List -> DataFrame by mappings\n", "itemsList.toDataFrame {\n", " \"a\" {first}\n", " \"b\" {second}\n", " \"c\" {first*second}\n", "}" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [], "source": [ "// Convert data frame to a list of data class items\n", "val passengers = df.toList(\"Passenger\")" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "class Line_139_jupyter$Passenger" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Check type of the element\n", "passengers[0].javaClass" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Passenger(row=10, pclass=1st, survived=0, name=Artagaveytia, Mr Ramon, age=71.0, embarked=Cherbourg, home=Montevideo, Uruguay, room=, ticket=, boat=(22), sex=male)" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Do any list operations\n", "passengers.maxBy {it.age ?: .0}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Column-specific extensions for TypedDataFrame" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "// create marker interface to write column-specific extensions for data frame\n", "@DataFrameType\n", "interface SimplePerson {\n", " val name: String\n", " val age: Double\n", "}" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "// create extension for any data frame with fields 'name' and 'age'\n", "fun TypedDataFrame.getOlderThan(minAge: Double) = filter {age > minAge}" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsex
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710female
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012female
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)male
291st1Bonnell, Miss Elizabeth58.0SouthamptonBirkdale, England Cleveland, OhioC-1038female
381st1Brown, Mrs John Murray (Caroline Lane Lamson)59.0SouthamptonBelmont, MAC-101Dfemale
391st1Bucknell, Mrs William Robert (Emma Eliza Ward)60.0CherbourgPhiladelphia, PA8female
421st1Candee, Mrs Edward (Helen Churchill Hungerford)53.0CherbourgWashington, DC6female
431st1Cardeza, Mrs James Warburton Martinez (Charlott...58.0CherbourgGermantown, Philadelphia, PAB-51/3/517755 L512 6s3female
681st1Compton, Mrs Alexander Taylor (Mary Eliza Inger...64.0CherbourgLakewood, NJ14female
711st1Cornell, Mrs Robert Clifford (Malvina Helen Lam...55.0SouthamptonNew York, NYC-1012female
731st0Crosby, Captain Edward Gifford70.0SouthamptonMilwaukee, WI(269)male
741st1Crosby, Mrs Edward Gifford (Catherine Elizabeth...69.0SouthamptonMilwaukee, WI5female
951st1Eustis, Miss Elizabeth Mussey53.0CherbourgBrookline, MA4female
1041st0Fortune, Mr Mark64.0SouthamptonWinnipeg, MBmale
1051st1Fortune, Mrs Mark (Mary McDougald)60.0SouthamptonWinnipeg, MB10female
1111st1Frolicher-Stehli, Mr Maxmillian60.0CherbourgZurich, Switzerland5male
1201st0Goldschmidt, Mr George B.71.0CherbourgNew York, NYmale
1211st1Gracie, Colonel Archibald IV54.0SouthamptonWashington, DCC-51113780 L28 10sBmale
1241st1Graham, Mrs William Thompson (Edith Junkins)58.0SouthamptonGreenwich, CTC-9117582 L153 9s 3d3female
1351st0Hays, Mr Charles Melville55.0SouthamptonMontreal, PQ(307)male

... only showing top 20 rows

" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// extension works even for objects that were created before marker interface declaration\n", "withAges.getOlderThan(50.0)" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "@DataFrameType(isOpen = true)\n", "interface Person{\n", "\tval name: String\n", "\tval age: Double\n", "\tval home: String\n", "\tval sex: String\n", "}" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// code for marker interface can be auto-generated\n", "// 'getScheme' method returns generated code without execution\n", "withAges.select{columns(name,age,home,sex)}.generateInterface(\"Person\")" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [], "source": [ "// 'extractScheme' method generates and executes code\n", "withAges.select{columns(name,age,home,sex)}.extractInterface(\"Person\")" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "// Now interface 'Person' is available, so we can write an extension method, \n", "// that will work for any data frame with these four columns\n", "fun TypedDataFrame.addSummary() = add(\"summary\"){\"$sex $name $age y.o. from $home\"}" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
rowpclasssurvivednameageembarkedhomeroomticketboatsexsummary
11st1Allen, Miss Elisabeth Walton29.0SouthamptonSt Louis, MOB-524160 L2212femalefemale Allen, Miss Elisabeth Walton 29.0 y.o. f...
21st0Allison, Miss Helen Loraine2.0SouthamptonMontreal, PQ / Chesterville, ONC26femalefemale Allison, Miss Helen Loraine 2.0 y.o. fro...
31st0Allison, Mr Hudson Joshua Creighton30.0SouthamptonMontreal, PQ / Chesterville, ONC26(135)malemale Allison, Mr Hudson Joshua Creighton 30.0 y...
41st0Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)25.0SouthamptonMontreal, PQ / Chesterville, ONC26femalefemale Allison, Mrs Hudson J.C. (Bessie Waldo D...
51st1Allison, Master Hudson Trevor0.9167SouthamptonMontreal, PQ / Chesterville, ONC2211malemale Allison, Master Hudson Trevor 0.9167 y.o. ...
61st1Anderson, Mr Harry47.0SouthamptonNew York, NYE-123malemale Anderson, Mr Harry 47.0 y.o. from New York...
71st1Andrews, Miss Kornelia Theodosia63.0SouthamptonHudson, NYD-713502 L7710femalefemale Andrews, Miss Kornelia Theodosia 63.0 y....
81st0Andrews, Mr Thomas, jr39.0SouthamptonBelfast, NIA-36malemale Andrews, Mr Thomas, jr 39.0 y.o. from Belf...
91st1Appleton, Mrs Edward Dale (Charlotte Lamson)58.0SouthamptonBayside, Queens, NYC-1012femalefemale Appleton, Mrs Edward Dale (Charlotte Lam...
101st0Artagaveytia, Mr Ramon71.0CherbourgMontevideo, Uruguay(22)malemale Artagaveytia, Mr Ramon 71.0 y.o. from Mont...
111st0Astor, Colonel John Jacob47.0CherbourgNew York, NY17754 L224 10s 6d(124)malemale Astor, Colonel John Jacob 47.0 y.o. from N...
121st1Astor, Mrs John Jacob (Madeleine Talmadge Force)19.0CherbourgNew York, NY17754 L224 10s 6d4femalefemale Astor, Mrs John Jacob (Madeleine Talmadg...
161st1Baxter, Mrs James (Helene DeLaudeniere Chaput)50.0CherbourgMontreal, PQB-58/606femalefemale Baxter, Mrs James (Helene DeLaudeniere C...
171st0Baxter, Mr Quigg Edmond24.0CherbourgMontreal, PQB-58/60malemale Baxter, Mr Quigg Edmond 24.0 y.o. from Mon...
181st0Beattie, Mr Thomson36.0CherbourgWinnipeg, MNC-6malemale Beattie, Mr Thomson 36.0 y.o. from Winnipe...
191st1Beckwith, Mr Richard Leonard37.0SouthamptonNew York, NYD-355malemale Beckwith, Mr Richard Leonard 37.0 y.o. fro...
201st1Beckwith, Mrs Richard Leonard (Sallie Monypeny)47.0SouthamptonNew York, NYD-355femalefemale Beckwith, Mrs Richard Leonard (Sallie Mo...
211st1Behr, Mr Karl Howell26.0CherbourgNew York, NYC-1485malemale Behr, Mr Karl Howell 26.0 y.o. from New Yo...
221st0Birnbaum, Mr Jakob25.0CherbourgSan Francisco, CA(148)malemale Birnbaum, Mr Jakob 25.0 y.o. from San Fran...
231st1Bishop, Mr Dickinson H.25.0CherbourgDowagiac, MIB-497malemale Bishop, Mr Dickinson H. 25.0 y.o. from Dow...

... only showing top 20 rows

" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// for example, it works for 'withAges' data frame\n", "withAges.addSummary()" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [], "source": [ "// data frame can also be converted to a list of objects implementing 'Person' interface that was generated above\n", "val persons = withAges.toList()" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "class Line_176_jupyter$PersonImpl" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// check element type\n", "persons[0].javaClass" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[PersonImpl(age=29.0, home=St Louis, MO, name=Allen, Miss Elisabeth Walton, sex=female), PersonImpl(age=2.0, home=Montreal, PQ / Chesterville, ON, name=Allison, Miss Helen Loraine, sex=female), PersonImpl(age=30.0, home=Montreal, PQ / Chesterville, ON, name=Allison, Mr Hudson Joshua Creighton, sex=male), PersonImpl(age=25.0, home=Montreal, PQ / Chesterville, ON, name=Allison, Mrs Hudson J.C. (Bessie Waldo Daniels), sex=female), PersonImpl(age=0.9167, home=Montreal, PQ / Chesterville, ON, name=Allison, Master Hudson Trevor, sex=male), PersonImpl(age=47.0, home=New York, NY, name=Anderson, Mr Harry, sex=male), PersonImpl(age=63.0, home=Hudson, NY, name=Andrews, Miss Kornelia Theodosia, sex=female), PersonImpl(age=39.0, home=Belfast, NI, name=Andrews, Mr Thomas, jr, sex=male), PersonImpl(age=58.0, home=Bayside, Queens, NY, name=Appleton, Mrs Edward Dale (Charlotte Lamson), sex=female), PersonImpl(age=71.0, home=Montevideo, Uruguay, name=Artagaveytia, Mr Ramon, sex=male), PersonImpl(age=47.0, home=New York, NY, name=Astor, Colonel John Jacob, sex=male), PersonImpl(age=19.0, home=New York, NY, name=Astor, Mrs John Jacob (Madeleine Talmadge Force), sex=female), PersonImpl(age=50.0, home=Montreal, PQ, name=Baxter, Mrs James (Helene DeLaudeniere Chaput), sex=female), PersonImpl(age=24.0, home=Montreal, PQ, name=Baxter, Mr Quigg Edmond, sex=male), PersonImpl(age=36.0, home=Winnipeg, MN, name=Beattie, Mr Thomson, sex=male), PersonImpl(age=37.0, home=New York, NY, name=Beckwith, Mr Richard Leonard, sex=male), PersonImpl(age=47.0, home=New York, NY, name=Beckwith, Mrs Richard Leonard (Sallie Monypeny), sex=female), PersonImpl(age=26.0, home=New York, NY, name=Behr, Mr Karl Howell, sex=male), PersonImpl(age=25.0, home=San Francisco, CA, name=Birnbaum, Mr Jakob, sex=male), PersonImpl(age=25.0, home=Dowagiac, MI, name=Bishop, Mr Dickinson H., sex=male), PersonImpl(age=19.0, home=Dowagiac, MI, name=Bishop, Mrs Dickinson H. (Helen Walton), sex=female), PersonImpl(age=28.0, home=Stockholm, Sweden / Washington, DC, name=Bjornstrm-Steffansson, Mr Mauritz Hakan, sex=male), PersonImpl(age=45.0, home=Trenton, NJ, name=Blackwell, Mr Stephen Weart, sex=male), PersonImpl(age=39.0, home=Glen Ridge, NJ, name=Blank, Mr Henry, sex=male), PersonImpl(age=30.0, home=Youngstown, OH, name=Bonnell, Miss Caroline, sex=female), PersonImpl(age=58.0, home=Birkdale, England Cleveland, Ohio, name=Bonnell, Miss Elizabeth, sex=female), PersonImpl(age=45.0, home=Cooperstown, NY, name=Bowen, Miss Grace Scott, sex=female), PersonImpl(age=22.0, home=St Leonards-on-Sea, England Ohio, name=Bowerman, Miss Elsie Edith, sex=female), PersonImpl(age=41.0, home=Pomeroy, WA, name=Brady, Mr John Bertram, sex=male), PersonImpl(age=48.0, home=Omaha, NE, name=Brandeis, Mr Emil, sex=male), PersonImpl(age=44.0, home=Denver, CO, name=Brown, Mrs James Joseph (Margaret Molly Tobin), sex=female), PersonImpl(age=59.0, home=Belmont, MA, name=Brown, Mrs John Murray (Caroline Lane Lamson), sex=female), PersonImpl(age=60.0, home=Philadelphia, PA, name=Bucknell, Mrs William Robert (Emma Eliza Ward), sex=female), PersonImpl(age=45.0, home=Washington, DC, name=Butt, Major Archibald Willingham, sex=male), PersonImpl(age=53.0, home=Washington, DC, name=Candee, Mrs Edward (Helen Churchill Hungerford), sex=female), PersonImpl(age=58.0, home=Germantown, Philadelphia, PA, name=Cardeza, Mrs James Warburton Martinez (Charlotte Wardle Drake), sex=female), PersonImpl(age=36.0, home=Austria-Hungary / Germantown, Philadelphia, PA, name=Cardeza, Mr Thomas Drake Martinez, sex=male), PersonImpl(age=33.0, home=New York, NY, name=Carlsson, Mr Frans Olof, sex=male), PersonImpl(age=36.0, home=Bryn Mawr, PA, name=Carter, Mr William Ernest, sex=male), PersonImpl(age=36.0, home=Bryn Mawr, PA, name=Carter, Mrs William Ernest (Lucile Polk), sex=female), PersonImpl(age=14.0, home=Bryn Mawr, PA, name=Carter, Miss Lucile Polk, sex=female), PersonImpl(age=11.0, home=Bryn Mawr, PA, name=Carter, Master William T. II, sex=male), PersonImpl(age=49.0, home=Ascot, Berkshire / Rochester, NY, name=Case, Mr Howard Brown, sex=male), PersonImpl(age=36.0, home=Little Onn Hall, Staffs, name=Cavendish, Mr Tyrell William, sex=male), PersonImpl(age=46.0, home=Amenia, ND, name=Chaffee, Mr Herbert Fuller, sex=male), PersonImpl(age=47.0, home=Amenia, ND, name=Chaffee, Mrs Herbert Fuller (Carrie Constance Toogood), sex=female), PersonImpl(age=27.0, home=New York, NY / Ithaca, NY, name=Chambers, Mr Norman Campbell, sex=male), PersonImpl(age=31.0, home=New York, NY / Ithaca, NY, name=Chambers, Mrs Norman Campbell (Bertha Griggs), sex=female), PersonImpl(age=27.0, home=Los Angeles, CA, name=Clark, Mr Walter Miller, sex=male), PersonImpl(age=26.0, home=Los Angeles, CA, name=Clark, Mrs Walter Miller (Virginia McDowell), sex=female), PersonImpl(age=64.0, home=Lakewood, NJ, name=Compton, Mrs Alexander Taylor (Mary Eliza Ingersoll), sex=female), PersonImpl(age=37.0, home=Lakewood, NJ, name=Compton, Mr Alexander Taylor, Jr, sex=male), PersonImpl(age=39.0, home=Lakewood, NJ, name=Compton, Miss Sara Rebecca, sex=female), PersonImpl(age=55.0, home=New York, NY, name=Cornell, Mrs Robert Clifford (Malvina Helen Lamson), sex=female), PersonImpl(age=70.0, home=Milwaukee, WI, name=Crosby, Captain Edward Gifford, sex=male), PersonImpl(age=69.0, home=Milwaukee, WI, name=Crosby, Mrs Edward Gifford (Catherine Elizabeth Halstead), sex=female), PersonImpl(age=36.0, home=Milwaukee, WI, name=Crosby, Miss Harriet R., sex=female), PersonImpl(age=39.0, home=New York, NY, name=Cumings, Mr John Bradley, sex=male), PersonImpl(age=38.0, home=New York, NY, name=Cumings, Mrs John Bradley (Florence Briggs Thayer), sex=female), PersonImpl(age=27.0, home=Philadelphia, PA, name=Daniel, Mr Robert Williams, sex=male), PersonImpl(age=31.0, home=Montreal, PQ, name=Davidson, Mr Thornton, sex=male), PersonImpl(age=27.0, home=Montreal, PQ, name=Davidson, Mrs Thornton (Orian Hays), sex=female), PersonImpl(age=31.0, home=Calgary, AB, name=Dick, Mr Albert Adrian, sex=male), PersonImpl(age=17.0, home=Calgary, AB, name=Dick, Mrs Albert Adrian Vera Gillespie, sex=female), PersonImpl(age=4.0, home=San Francisco, CA, name=Dodge, Master Washington, sex=male), PersonImpl(age=27.0, home=Montreal, PQ, name=Douglas, Mrs Frederick Charles (Suzette Baxter), sex=female), PersonImpl(age=50.0, home=Deephaven, MN / Cedar Rapids, IA, name=Douglas, Mr Walter Donald, sex=male), PersonImpl(age=48.0, home=Deephaven, MN / Cedar Rapids, IA, name=Douglas, Mrs Walter Donald (Mahala Dutton), sex=female), PersonImpl(age=49.0, home=London / Paris, name=Duff Gordon, Sir Cosmo Edmund, sex=male), PersonImpl(age=48.0, home=London / Paris, name=Duff Gordon, Lady (Lucille Wallace Sutherland), sex=female), PersonImpl(age=39.0, home=Philadelphia, PA, name=Dulles, Mr William Crothers, sex=male), PersonImpl(age=23.0, home=Mt Airy, Philadelphia, PA, name=Earnshaw, Mrs Boulton (Olive Potter), sex=female), PersonImpl(age=53.0, home=Brookline, MA, name=Eustis, Miss Elizabeth Mussey, sex=female), PersonImpl(age=36.0, home=New York, NY, name=Evans, Miss Edith Corse, sex=female), PersonImpl(age=30.0, home=New York, NY, name=Foreman, Mr Benjamin Laventall, sex=male), PersonImpl(age=24.0, home=Winnipeg, MB, name=Fortune, Miss Alice Elizabeth, sex=female), PersonImpl(age=19.0, home=Winnipeg, MB, name=Fortune, Mr Charles Alexander, sex=male), PersonImpl(age=28.0, home=Winnipeg, MB, name=Fortune, Miss Ethel Flora, sex=female), PersonImpl(age=23.0, home=Winnipeg, MB, name=Fortune, Miss Mabel, sex=female), PersonImpl(age=64.0, home=Winnipeg, MB, name=Fortune, Mr Mark, sex=male), PersonImpl(age=60.0, home=Winnipeg, MB, name=Fortune, Mrs Mark (Mary McDougald), sex=female), PersonImpl(age=49.0, home=New York, NY, name=Frauenthal, Dr Henry William, sex=male), PersonImpl(age=44.0, home=New York, NY, name=Frauenthal, Mr Isaac Gerald, sex=male), PersonImpl(age=22.0, home=Zurich, Switzerland, name=Frolicher, Miss Marguerite, sex=female), PersonImpl(age=60.0, home=Zurich, Switzerland, name=Frolicher-Stehli, Mr Maxmillian, sex=male), PersonImpl(age=48.0, home=Zurich, Switzerland, name=Frolicher-Stehli, Mrs Maxmillian (Margaretha Emerentia Stehli), sex=female), PersonImpl(age=37.0, home=Scituate, MA, name=Futrelle, Mr Jacques, sex=male), PersonImpl(age=35.0, home=Scituate, MA, name=Futrelle, Mrs Jacques (May Peel), sex=female), PersonImpl(age=47.0, home=St Anne's-on-Sea, Lancashire, name=Gee, Mr Arthur H., sex=male), PersonImpl(age=22.0, home=New York, NY, name=Gibson, Miss Dorothy, sex=female), PersonImpl(age=45.0, home=New York, NY, name=Gibson, Mrs Leonard (Pauline C. Boeson), sex=female), PersonImpl(age=49.0, home=Paris, France / New York, NY, name=Goldenberg, Mr Samuel L., sex=male), PersonImpl(age=71.0, home=New York, NY, name=Goldschmidt, Mr George B., sex=male), PersonImpl(age=54.0, home=Washington, DC, name=Gracie, Colonel Archibald IV, sex=male), PersonImpl(age=38.0, home=Winnipeg, MB, name=Graham, Mr George Edward, sex=male), PersonImpl(age=19.0, home=Greenwich, CT, name=Graham, Miss Margaret Edith, sex=female), PersonImpl(age=58.0, home=Greenwich, CT, name=Graham, Mrs William Thompson (Edith Junkins), sex=female), PersonImpl(age=45.0, home=New York, NY, name=Greenfield, Mrs Leo David (Blanche Strouse), sex=female), PersonImpl(age=23.0, home=New York, NY, name=Greenfield, Mr William Bertram, sex=male), PersonImpl(age=46.0, home=New York, NY, name=Guggenheim, Mr Benjamin, sex=male), PersonImpl(age=25.0, home=Brooklyn, NY, name=Harder, Mr George Achilles, sex=male), PersonImpl(age=21.0, home=Brooklyn, NY, name=Harder, Mrs George Achilles (Dorothy Annan), sex=female), PersonImpl(age=48.0, home=New York, NY, name=Harper, Mr Henry Sleeper, sex=male), PersonImpl(age=49.0, home=New York, NY, name=Harper, Mrs Henry Sleeper (Myna Haxtun), sex=female), PersonImpl(age=45.0, home=New York, NY, name=Harris, Mr Henry Birkhardt, sex=male), PersonImpl(age=36.0, home=New York, NY, name=Harris, Mrs Henry Birkhardt (Irene Wallach), sex=female), PersonImpl(age=55.0, home=Montreal, PQ, name=Hays, Mr Charles Melville, sex=male), PersonImpl(age=52.0, home=Montreal, PQ, name=Hays, Mrs Charles Melville (Clara Jennings Gregg), sex=female), PersonImpl(age=24.0, home=New York, NY, name=Hays, Miss Margaret Bechstein, sex=female), PersonImpl(age=16.0, home=Chicago, IL, name=Hippach, Miss Jean Gertrude, sex=female), PersonImpl(age=44.0, home=Chicago, IL, name=Hippach, Mrs Louis Albert (Ida Sophia Fischer), sex=female), PersonImpl(age=51.0, home=Hudson, NY, name=Hogeboom, Mrs John C. (Anna Andrews), sex=female), PersonImpl(age=42.0, home=New York, NY, name=Holverson, Mr Alexander Oskar, sex=male), PersonImpl(age=35.0, home=New York, NY, name=Holverson, Mrs Alexander Oskar (Mary Aline Towner), sex=female), PersonImpl(age=35.0, home=Indianapolis, IN, name=Homer, Mr Harry, sex=male), PersonImpl(age=38.0, home=New York, NY / Stamford CT, name=Hoyt, Mr Frederick Maxfield, sex=male), PersonImpl(age=35.0, home=New York, NY / Stamford CT, name=Hoyt, Mrs Frederick Maxfield (Jane Anne Forby), sex=female), PersonImpl(age=50.0, home=Paris, France New York, NY, name=Isham, Miss Anne Elizabeth, sex=female), PersonImpl(age=49.0, home=Liverpool, name=Ismay, Mr Joseph Bruce, sex=male), PersonImpl(age=46.0, home=Bennington, VT, name=Jones, Mr Charles Cresson, sex=male), PersonImpl(age=58.0, home=Buffalo, NY, name=Kent, Mr Edward Austin, sex=male), PersonImpl(age=41.0, home=Southington / Noank, CT, name=Kenyon, Mr Frederick R., sex=male), PersonImpl(age=42.0, home=Boston, MA, name=Kimball, Mr Edwin Nelson Jr., sex=male), PersonImpl(age=40.0, home=Boston, MA, name=Kimball, Mrs Edwin Nelson Jr. (Gertrude Parsons), sex=female), PersonImpl(age=42.0, home=Stockholm, Sweden, name=Lindeberg-Lind, Mr Erik Gustaf, sex=male), PersonImpl(age=55.0, home=Stockholm, Sweden, name=Lindstrom, Mrs Carl Johan (Sigrid Posse), sex=female), PersonImpl(age=50.0, home=Paris, France, name=Lines, Mrs Ernest H. (Elizabeth Lindsey James), sex=female), PersonImpl(age=16.0, home=Paris, France, name=Lines, Miss Mary Conover, sex=female), PersonImpl(age=29.0, home=Springfield, MA, name=Long, Mr Milton Clyde, sex=male), PersonImpl(age=21.0, home=Hudson, NY, name=Longley, Miss Gretchen Fiske, sex=female), PersonImpl(age=30.0, home=London / New York, NY, name=Loring, Mr Joseph Holland, sex=male), PersonImpl(age=15.0, home=St Louis, MO, name=Madill, Miss Georgette Alexandra, sex=female), PersonImpl(age=30.0, home=Brockton, MA, name=Maguire, Mr John Edward, sex=male), PersonImpl(age=46.0, home=Vancouver, BC, name=McCaffry, Mr Thomas Francis, sex=male), PersonImpl(age=54.0, home=Dorchester, MA, name=McCarthy, Mr Timothy J., sex=male), PersonImpl(age=36.0, home=Philadelphia, PA, name=McGough, Mr James R., sex=male), PersonImpl(age=28.0, home=New York, NY, name=Meyer, Mr Edgar Joseph, sex=male), PersonImpl(age=65.0, home=East Bridgewater, MA, name=Millet, Mr Francis Davis, sex=male), PersonImpl(age=33.0, home=Green Bay, WI, name=Minahan, Miss Daisy E., sex=female), PersonImpl(age=44.0, home=Fond du Lac, WI, name=Minahan, Dr William Edward, sex=male), PersonImpl(age=37.0, home=Fond du Lac, WI, name=Minahan, Mrs William Edward (Lillian E. Thorpe), sex=female), PersonImpl(age=55.0, home=Montreal, PQ, name=Molson, Mr Harry Markland, sex=male), PersonImpl(age=47.0, home=Washington, DC, name=Moore, Mr Clarence Bloomfield, sex=male), PersonImpl(age=36.0, home=Brooklyn, NY, name=Natsch, Mr Charles H., sex=male), PersonImpl(age=58.0, home=Lexington, MA, name=Newell, Mr Arthur Webster, sex=male), PersonImpl(age=31.0, home=Lexington, MA, name=Newell, Miss Madeleine, sex=female), PersonImpl(age=23.0, home=Lexington, MA, name=Newell, Miss Marjorie, sex=female), PersonImpl(age=19.0, home=New York, NY, name=Newsom, Miss Helen Monypeny, sex=female), PersonImpl(age=64.0, home=Isle of Wight, England, name=Nicholson, Mr Arthur Ernest, sex=male), PersonImpl(age=64.0, home=Providence, RI, name=Ostby, Mr Engelhart Cornelius, sex=male), PersonImpl(age=22.0, home=Providence, RI, name=Ostby, Miss Helen Raghnild, sex=female), PersonImpl(age=28.0, home=?Havana, Cuba, name=Ovies y Rodriguez, Mr Servando, sex=male), PersonImpl(age=22.0, home=Montreal, PQ, name=Payne, Mr Vivian Ponsonby, sex=male), PersonImpl(age=18.0, home=Madrid, Spain, name=Penasco, Mr Victor de Satode, sex=male), PersonImpl(age=17.0, home=Madrid, Spain, name=Penasco, Mrs Victor de Satode (Josefa de Soto), sex=female), PersonImpl(age=52.0, home=Toronto, ON, name=Peuchen, Major Arthur Godfrey, sex=male), PersonImpl(age=46.0, home=Worcester, MA, name=Porter, Mr Walter Chamberlain, sex=male), PersonImpl(age=56.0, home=Mt Airy, Philadelphia, PA, name=Potter, Mrs Thomas, Jr. (Lily Alexenia Wilson), sex=female), PersonImpl(age=43.0, home=St Louis, MO, name=Robert, Mrs Edward Scott (Elisabeth Walton McMillan), sex=female), PersonImpl(age=31.0, home=Trenton, NJ, name=Roebling, Mr Washington Augustus 2nd, sex=male), PersonImpl(age=33.0, home=Paris, France, name=Rosenbaum (Russell), Miss Edith Louise, sex=female), PersonImpl(age=27.0, home=London Vancouver, BC, name=Rothes, the Countess of (Noel Lucy Martha Dyer-Edwardes), sex=female), PersonImpl(age=55.0, home=New York, NY, name=Rothschild, Mr Martin, sex=male), PersonImpl(age=54.0, home=New York, NY, name=Rothschild, Mrs Martin (Elizabeth L. Barrett), sex=female), PersonImpl(age=61.0, home=Haverford, PA / Cooperstown, NY, name=Ryerson, Mr Arthur Larned, sex=male), PersonImpl(age=48.0, home=Haverford, PA / Cooperstown, NY, name=Ryerson, Mrs Arthur Larned (Emily Maria Borie), sex=female), PersonImpl(age=18.0, home=Haverford, PA / Cooperstown, NY, name=Ryerson, Miss Emily Borie, sex=female), PersonImpl(age=13.0, home=Haverford, PA / Cooperstown, NY, name=Ryerson, Master John Borie, sex=male), PersonImpl(age=21.0, home=Haverford, PA / Cooperstown, NY, name=Ryerson, Miss Susan (Suzette) Parker, sex=female), PersonImpl(age=34.0, home=New York, NY, name=Seward, Mr Frederic Kimber, sex=male), PersonImpl(age=40.0, home=New York, NY / Greenwich CT, name=Shutes, Miss Elizabeth W., sex=female), PersonImpl(age=36.0, home=St Louis, MO, name=Silverthorne, Mr Spencer Victor, sex=male), PersonImpl(age=50.0, home=Duluth, MN, name=Silvey, Mr William Baird, sex=male), PersonImpl(age=39.0, home=Duluth, MN, name=Silvey, Mrs William Baird (Alice Munger), sex=female), PersonImpl(age=56.0, home=Basel, Switzerland, name=Simonius-Blumer, Col Alfons, sex=male), PersonImpl(age=28.0, home=New Britain, CT, name=Sloper, Mr William Thompson, sex=male), PersonImpl(age=56.0, home=New York, NY, name=Smart, Mr John Montgomery, sex=male), PersonImpl(age=56.0, home=St James, Long Island, NY, name=Smith, Mr James Clinch, sex=male), PersonImpl(age=24.0, home=Huntington, WV, name=Smith, Mr Lucien Philip, sex=male), PersonImpl(age=18.0, home=Huntington, WV, name=Smith, Mrs Lucien Philip (Mary Eloise Hughes, sex=female), PersonImpl(age=24.0, home=Minneapolis, MN, name=Snyder, Mr John Pillsbury, sex=male), PersonImpl(age=23.0, home=Minneapolis, MN, name=Snyder, Mrs John Pillsbury (Nelle Stevenson), sex=female), PersonImpl(age=45.0, home=Tuxedo Park, NY, name=Spedden, Mr Frederick Oakley, sex=male), PersonImpl(age=40.0, home=Tuxedo Park, NY, name=Spedden, Mrs Frederick Oakley (Margaretta Corning Stone), sex=female), PersonImpl(age=6.0, home=Tuxedo Park, NY, name=Spedden, Master Robert Douglas, sex=male), PersonImpl(age=57.0, home=Paris, France, name=Spencer, Mr William Augustus, sex=male), PersonImpl(age=32.0, home=Basel, Switzerland, name=Staehlin, Dr Max, sex=male), PersonImpl(age=62.0, home=Wimbledon Park, London / Hayling Island, Hants, name=Stead, Mr William Thomas, sex=male), PersonImpl(age=54.0, home=Newark, NJ, name=Stengel, Mr Charles Emil Henry, sex=male), PersonImpl(age=43.0, home=Newark, NJ, name=Stengel, Mrs Charles Emil Henry (Annie May Morris), sex=female), PersonImpl(age=52.0, home=Haverford, PA, name=Stephenson, Mrs Walter Bertram (Martha Eustis), sex=female), PersonImpl(age=62.0, home=Cincinatti, OH, name=Stone, Mrs George Nelson (Martha E.), sex=female), PersonImpl(age=67.0, home=New York, NY, name=Straus, Mr Isidor, sex=male), PersonImpl(age=63.0, home=New York, NY, name=Straus, Mrs Isidor (Ida Blun), sex=female), PersonImpl(age=61.0, home=Haddenfield, NJ, name=Sutton, Mr Frederick, sex=male), PersonImpl(age=46.0, home=Brooklyn, NY, name=Swift, Mrs Frederick Joel (Margaret Welles Barron), sex=female), PersonImpl(age=52.0, home=New York, NY, name=Taussig, Mr Emil, sex=male), PersonImpl(age=39.0, home=New York, NY, name=Taussig, Mrs Emil (Tillie Mandelbaum), sex=female), PersonImpl(age=18.0, home=New York, NY, name=Taussig, Miss Ruth, sex=female), PersonImpl(age=48.0, home=London / East Orange, NJ, name=Taylor, Mr Elmer Zebley, sex=male), PersonImpl(age=49.0, home=Haverford, PA, name=Thayer, Mr John Borland, sex=male), PersonImpl(age=39.0, home=Haverford, PA, name=Thayer, Mrs John Borland (Marian Longstreth Morris), sex=female), PersonImpl(age=17.0, home=Haverford, PA, name=Thayer, Mr John Borland, jr., sex=male), PersonImpl(age=46.0, home=New York, NY, name=Thorne, Mr George (alias of: Mr George Rosenshine), sex=male), PersonImpl(age=31.0, home=Albany, NY, name=Tucker, Mr Gilbert Milligan, jr, sex=male), PersonImpl(age=61.0, home=Brooklyn, NY, name=Van Derhoef, Mr Wyckoff, sex=male), PersonImpl(age=47.0, home=East Orange, NJ, name=Walker, Mr William Anderson, sex=male), PersonImpl(age=64.0, home=Portland, OR, name=Warren, Mr Frank Manley, sex=male), PersonImpl(age=60.0, home=Portland, OR, name=Warren, Mrs Frank Manley (Anna S. Atkinson), sex=female), PersonImpl(age=60.0, home=England Salt Lake City, Utah, name=Weir, Col John, sex=male), PersonImpl(age=55.0, home=New York, NY / Briarcliff Manor NY, name=White, Mrs J. Stuart (Ella Holmes), sex=female), PersonImpl(age=54.0, home=Brunswick, ME, name=White, Mr Percival Wayland, sex=male), PersonImpl(age=21.0, home=Brunswick, ME, name=White, Mr Richard Frasar, sex=male), PersonImpl(age=57.0, home=Youngstown, OH, name=Wick, Mr George Dennick, sex=male), PersonImpl(age=45.0, home=Youngstown, OH, name=Wick, Mrs George Dennick (Martha Hitchcock), sex=female), PersonImpl(age=31.0, home=Youngstown, OH, name=Wick, Miss Mary Natalie, sex=female), PersonImpl(age=50.0, home=Elkins Park, PA, name=Widener, Mr George Dunton, sex=male), PersonImpl(age=50.0, home=Elkins Park, PA, name=Widener, Mrs George Dunton (Eleanor Elkins), sex=female), PersonImpl(age=27.0, home=Elkins Park, PA, name=Widener, Mr Harry Elkins, sex=male), PersonImpl(age=20.0, home=Duluth, MN, name=Willard, Miss Constance, sex=female), PersonImpl(age=51.0, home=Geneva, Switzerland / Radnor, PA, name=Williams, Mr Charles Duane, sex=male), PersonImpl(age=21.0, home=Geneva, Switzerland / Radnor, PA, name=Williams, Mr Richard Norris II, sex=male), PersonImpl(age=36.0, home=New York, NY / Washington, DC, name=Young, Miss Marie Grice, sex=female), PersonImpl(age=40.0, home=, name=Harrison, Mr William \tHenry, sex=male), PersonImpl(age=32.0, home=, name=Keeping, Mr Edwin, sex=male), PersonImpl(age=33.0, home=, name=Ringhini, Mr Sante, sex=male), PersonImpl(age=30.0, home=Russia New York, NY, name=Abelson, Mr Samuel, sex=male), PersonImpl(age=28.0, home=Russia New York, NY, name=Abelson, Mrs Samuel (Anna), sex=female), PersonImpl(age=18.0, home=Buenos Aires, Argentina / New Jersey, NJ, name=Andrew, Mr Edgar Samuel, sex=male), PersonImpl(age=34.0, home=Warwick, England, name=Angle, Mr William A., sex=male), PersonImpl(age=32.0, home=Warwick, England, name=Angle, Mrs William A. (Florence), sex=female), PersonImpl(age=57.0, home=West Hoboken, NJ, name=Ashby, Mr John, sex=male), PersonImpl(age=18.0, home=Penzance, Cornwall / Akron, OH, name=Bailey, Mr Percy Andrew, sex=male), PersonImpl(age=23.0, home=Guernsey, name=Baimbrigge, Mr Charles R., sex=male), PersonImpl(age=36.0, home=Bristol, Avon / Jacksonville, FL, name=Balls, Mrs Ada E. Hall, sex=female), PersonImpl(age=28.0, home=Plymouth, Dorset / Houghton, MI, name=Banfield, Mr Frederick J., sex=male), PersonImpl(age=51.0, home=Jacksonville, FL, name=Bateman, Rev Robert James, sex=male), PersonImpl(age=32.0, home=Norwich / New York, NY, name=Beane, Mr Edward, sex=male), PersonImpl(age=19.0, home=Norwich / New York, NY, name=Beane, Mrs Edward (Ethel Clarke), sex=female), PersonImpl(age=28.0, home=England, name=Beauchamp, Mr Henry James, sex=male), PersonImpl(age=36.0, home=Guntur, India / Benton Harbour, MI, name=Becker, Mrs Allen Oliver (Nellie E. Baumgardner), sex=female), PersonImpl(age=4.0, home=Guntur, India / Benton Harbour, MI, name=Becker, Miss Marion Louise, sex=female), PersonImpl(age=1.0, home=Guntur, India / Benton Harbour, MI, name=Becker, Master Richard F., sex=male), PersonImpl(age=12.0, home=Guntur, India / Benton Harbour, MI, name=Becker, Miss Ruth Elizabeth, sex=female), PersonImpl(age=34.0, home=London, name=Beesley, Mr Lawrence, sex=male), PersonImpl(age=19.0, home=Rochester, NY, name=Bentham, Miss Lilian W., sex=female), PersonImpl(age=23.0, home=St Ives, Cornwall / Calumet, MI, name=Berriman, Mr William S., sex=male), PersonImpl(age=26.0, home=Elmira, NY / Orange, NJ, name=Botsford, Mr William Hull, sex=male), PersonImpl(age=27.0, home=Lake Arthur, Chavez County, NM, name=Bracken, Mr James H., sex=male), PersonImpl(age=15.0, home=Cape Town, South Africa / Seattle, WA, name=Brown, Miss Edith E., sex=female), PersonImpl(age=45.0, home=Cape Town, South Africa / Seattle, WA, name=Brown, Mr Thomas William Solomon, sex=male), PersonImpl(age=40.0, home=Cape Town, South Africa / Seattle, WA, name=Brown, Mrs Thomas William Solomon (Elizabeth C.), sex=female), PersonImpl(age=20.0, home=Skara, Sweden / Rockford, IL, name=Bryhl, Miss Dagmar, sex=female), PersonImpl(age=25.0, home=Skara, Sweden / Rockford, IL, name=Bryhl, Mr Kurt Arnold Gottfrid, sex=male), PersonImpl(age=36.0, home=Sittingbourne, England / San Diego, CA, name=Buss, Miss Kate, sex=female), PersonImpl(age=25.0, home=Southsea, Hants, name=Butler, Mr Reginald Fenton, sex=male), PersonImpl(age=42.0, home=New York, NY, name=Bystrom, Mrs Carolina, sex=female), PersonImpl(age=26.0, home=Bangkok, Thailand / Roseville, IL, name=Caldwell, Mr Albert Francis, sex=male), PersonImpl(age=26.0, home=Bangkok, Thailand / Roseville, IL, name=Caldwell, Mrs Albert Francis (Sylvia Mae Harbaugh), sex=female), PersonImpl(age=0.8333, home=Bangkok, Thailand / Roseville, IL, name=Caldwell, Master Alden Gates, sex=male), PersonImpl(age=31.0, home=Mamaroneck, NY, name=Cameron, Miss Clear, sex=female), PersonImpl(age=19.0, home=St Ives, Cornwall / Calumet, MI, name=Carbines, Mr William, sex=male), PersonImpl(age=54.0, home=London, name=Carter, Rev Ernest Courtenay, sex=male), PersonImpl(age=44.0, home=London, name=Carter, Mrs Ernest Courtenay (Lillian Hughes), sex=female), PersonImpl(age=52.0, home=Bronx, NY, name=Chapman, Mr Charles Henry, sex=male), PersonImpl(age=30.0, home=Cornwall / Spokane, WA, name=Chapman, Mr John Henry, sex=male), PersonImpl(age=30.0, home=Cornwall / Spokane, WA, name=Chapman, Mrs John Henry (Elizabeth Lawry), sex=female), PersonImpl(age=29.0, home=England / San Francisco, CA, name=Clarke, Mr Charles V., sex=male), PersonImpl(age=29.0, home=Hartford, Huntingdonshire, name=Coleridge, Mr Reginald Charles, sex=male), PersonImpl(age=27.0, home=Helsinki, Finland Ashtabula, Ohio, name=Collander, Mr Erik, sex=male), PersonImpl(age=24.0, home=London / Fort Byron, NY, name=Collett, Mr Sidney C. Stuart, sex=male), PersonImpl(age=35.0, home=Bishopstoke, Hants / Fayette Valley, ID, name=Collyer, Mr Harvey, sex=male), PersonImpl(age=31.0, home=Bishopstoke, Hants / Fayette Valley, ID, name=Collyer, Mrs Harvey (Charlotte Tate), sex=female), PersonImpl(age=8.0, home=Bishopstoke, Hants / Fayette Valley, ID, name=Collyer, Miss Marjorie, sex=female), PersonImpl(age=22.0, home=Pennsylvania, name=Cook, Mrs Selena Rogers, sex=female), PersonImpl(age=30.0, home=Provo, UT, name=Corbett, Mrs Walter H. (Irene Colvin), sex=female), PersonImpl(age=20.0, home=Penzance, Cornwall / Akron, OH, name=Cotterill, Mr Harry, sex=male), PersonImpl(age=21.0, home=Lyndhurst, England, name=Davies, Mr Charles Henry, sex=male), PersonImpl(age=49.0, home=St Ives, Cornwall / Hancock, MI, name=Davis, Mrs Agnes, sex=female), PersonImpl(age=8.0, home=St Ives, Cornwall / Hancock, MI, name=Davis, Master John Morgan, sex=male), PersonImpl(age=28.0, home=London / Staten Island, NY, name=Davis, Miss Mary, sex=female), PersonImpl(age=18.0, home=, name=Deacon, Mr Percy, sex=male), PersonImpl(age=28.0, home=Lucca, Italy / California, name=del Carlo, Mr Sebastiano, sex=male), PersonImpl(age=22.0, home=Lucca, Italy / California, name=del Carlo, Mrs Sebastiano (Argenia Genovese), sex=female), PersonImpl(age=25.0, home=Guernsey / Elizabeth, NJ, name=Denbury, Mr Herbert, sex=male), PersonImpl(age=18.0, home=New Forest, England, name=Dibden, Mr William, sex=male), PersonImpl(age=32.0, home=Southampton, name=Doling, Mrs Ada, sex=female), PersonImpl(age=18.0, home=Southampton, name=Doling, Miss Elsie, sex=female), PersonImpl(age=42.0, home=Greenport, NY, name=Drew, Mr James Vivian, sex=male), PersonImpl(age=34.0, home=Greenport, NY, name=Drew, Mrs James Vivian (Lulu Thorne Christian), sex=female), PersonImpl(age=8.0, home=Greenport, NY, name=Drew, Master Marshall Brines, sex=male), PersonImpl(age=23.0, home=England / Detroit, MI, name=Eitemiller, Mr George Floyd, sex=male), PersonImpl(age=21.0, home=Goteborg, Sweden / Rockford, IL, name=Enander, Mr Ingvar, sex=male), PersonImpl(age=19.0, home=Oslo, Norway Bayonne, NJ, name=Fahlstrom, Mr Arne Jonas, sex=male), PersonImpl(age=38.0, home=Rochester, NY, name=Fox, Mr Stanley H., sex=male), PersonImpl(age=38.0, home=Janjgir, India / Pennsylvania, name=Funk, Miss Annie C., sex=female), PersonImpl(age=35.0, home=Liverpool / Montreal, PQ, name=Fynney, Mr Joseph J., sex=male), PersonImpl(age=35.0, home=Cornwall / Clear Creek, CO, name=Gale, Mr Harry, sex=male), PersonImpl(age=38.0, home=Cornwall / Clear Creek, CO, name=Gale, Mr Shadrach, sex=male), PersonImpl(age=24.0, home=Brooklyn, NY, name=Garside, Miss Ethel, sex=female), PersonImpl(age=16.0, home=Liverpool / Montreal, PQ, name=Gaskell, Mr Alfred, sex=male), PersonImpl(age=26.0, home=Guernsey / Elizabeth, NJ, name=Gavey, Mr Lawrence, sex=male), PersonImpl(age=45.0, home=Cornwall, name=Gilbert, Mr William, sex=male), PersonImpl(age=24.0, home=Cornwall / Camden, NJ, name=Giles, Mr Edgar, sex=male), PersonImpl(age=21.0, home=Cornwall / Camden, NJ, name=Giles, Mr Frederick, sex=male), PersonImpl(age=22.0, home=West Kensington, London, name=Giles, Mr Ralph, sex=male), PersonImpl(age=34.0, home=Vancouver, BC, name=Gillespie, Mr William, sex=male), PersonImpl(age=30.0, home=, name=Givard, Mr Hans Christensen, sex=male), PersonImpl(age=50.0, home=Bronx, NY, name=Greenberg, Mr Samuel, sex=male), PersonImpl(age=30.0, home=Auburn, NY, name=Hale, Mr Reginald, sex=male), PersonImpl(age=23.0, home=Detroit, MI, name=Hamalainen, Mrs William (Anna), sex=female), PersonImpl(age=1.0, home=Detroit, MI, name=Hamalainen, Master Viljo, sex=male), PersonImpl(age=44.0, home=Seattle, WA / Toledo, OH, name=Harbeck, Mr William H., sex=male), PersonImpl(age=28.0, home=Denmark Hill, Surrey / Chicago, name=Harper, Rev John, sex=male), PersonImpl(age=6.0, home=Denmark Hill, Surrey / Chicago, name=Harper, Miss Nina, sex=female), PersonImpl(age=30.0, home=London, name=Harris, Mr George, sex=male), PersonImpl(age=43.0, home=Ilford, Essex / Winnipeg, MB, name=Hart, Mr Benjamin, sex=male), PersonImpl(age=45.0, home=Ilford, Essex / Winnipeg, MB, name=Hart, Mrs Benjamin (Esther), sex=female), PersonImpl(age=7.0, home=Ilford, Essex / Winnipeg, MB, name=Hart, Miss Eva Miriam, sex=female), PersonImpl(age=24.0, home=Somerset / Bernardsville, NJ, name=Herman, Miss Alice, sex=female), PersonImpl(age=24.0, home=Somerset / Bernardsville, NJ, name=Herman, Miss Kate, sex=female), PersonImpl(age=49.0, home=Somerset / Bernardsville, NJ, name=Herman, Mr Samuel, sex=male), PersonImpl(age=48.0, home=Somerset / Bernardsville, NJ, name=Herman, Mrs Samuel (Jane Laver), sex=female), PersonImpl(age=34.0, home=West Hampstead, London / Neepawa, MB, name=Hickman, Mr Leonard Mark, sex=male), PersonImpl(age=32.0, home=West Hampstead, London / Neepawa, MB, name=Hickman, Mr Lewis, sex=male), PersonImpl(age=21.0, home=West Hampstead, London / Neepawa, MB, name=Hickman, Mr Stanley George, sex=male), PersonImpl(age=18.0, home=Kontiolahti, Finland / Detroit, MI, name=Hiltunen, Miss Marta, sex=female), PersonImpl(age=53.0, home=Cornwall / Akron, OH, name=Hocking, Mrs Elizabeth, sex=female), PersonImpl(age=23.0, home=Cornwall / Akron, OH, name=Hocking, Mr George, sex=male), PersonImpl(age=21.0, home=Cornwall / Akron, OH, name=Hocking, Miss Ellen (Nellie), sex=female), PersonImpl(age=52.0, home=Southampton, name=Hodges, Mr Henry Price, sex=male), PersonImpl(age=42.0, home=England / Sacramento, CA, name=Hold, Mr Stephen, sex=male), PersonImpl(age=36.0, home=England / Sacramento, CA, name=Hold, Mrs Stephen (Annie Margaret), sex=female), PersonImpl(age=21.0, home=New Forest, England, name=Hood, Mr Ambrose, Jr, sex=male), PersonImpl(age=41.0, home=Tokyo, Japan, name=Hosono, Mr Masafumi, sex=male), PersonImpl(age=33.0, home=Philadelphia, PA, name=Hunt, Mr George Henry, sex=male), PersonImpl(age=17.0, home=Guernsey, name=Ilett, Miss Bertha, sex=female), PersonImpl(age=23.0, home=New York, NY, name=Jerwan, Mrs Amin S. (Marie Thuillard), sex=female), PersonImpl(age=34.0, home=Moscow / Bronx, NY, name=Kantor, Mr Sinai, sex=male), PersonImpl(age=22.0, home=India / Pittsburgh, PA, name=Karnes, Mrs J. Frank (Claire Bennett), sex=female), PersonImpl(age=45.0, home=London / New York, NY, name=Kelly, Mrs Florence (Fannie), sex=female), PersonImpl(age=31.0, home=Sweden / Arlington, NJ, name=Kvillner, Mr Johan Henrik Johannesson, sex=male), PersonImpl(age=30.0, home=Minneapolis, MN, name=Lahtinen, Rev William, sex=male), PersonImpl(age=26.0, home=Minneapolis, MN, name=Lahtinen, Mrs William (Anna Sylvan), sex=female), PersonImpl(age=34.0, home=Chicago, IL, name=Lemore, Mrs Amelia, sex=female), PersonImpl(age=26.0, home=Paris / Haiti, name=LaRoche, Mr Joseph, sex=male), PersonImpl(age=22.0, home=Paris / Haiti, name=LaRoche, Mrs Joseph (Juliet), sex=female), PersonImpl(age=1.0, home=Paris / Haiti, name=LaRoche, Miss Louise, sex=female), PersonImpl(age=3.0, home=Paris / Haiti, name=LaRoche, Miss Simonne, sex=female), PersonImpl(age=25.0, home=, name=Leyson, Mr Robert William Norman, sex=male), PersonImpl(age=48.0, home=Weston-Super-Mare, Somerset, name=Louch, Mr Charles Alexander, sex=male), PersonImpl(age=57.0, home=Southampton / New York, NY, name=Mack, Mrs Mary, sex=female), PersonImpl(age=2.0, home=Paris / Montreal, PQ, name=Mallet, Master Andre, sex=male), PersonImpl(age=27.0, home=Worcester, MA, name=Mantvila, Rev Joseph, sex=male), PersonImpl(age=19.0, home=Worcester, England, name=Marshall, Mrs Kate Louise Phillips, sex=female), PersonImpl(age=30.0, home=St Austall, Cornwall, name=Matthews, Mr William John, sex=male), PersonImpl(age=20.0, home=Weston-Super-Mare / Moose Jaw, SK, name=Maybery, Mr Frank H., sex=male), PersonImpl(age=45.0, home=Sydney, Australia, name=McCrae, Mr Arthur Gordon, sex=male), PersonImpl(age=46.0, home=Rochester, NY, name=McKane, Mr Peter D., sex=male), PersonImpl(age=41.0, home=England / Bennington, VT, name=Mellenger, Mrs Elizabeth Anne, sex=female), PersonImpl(age=13.0, home=England / Bennington, VT, name=Mellenger, Miss Madeleine Violet, sex=female), PersonImpl(age=19.0, home=Chelsea, London, name=Mellor, Mr William John, sex=male), PersonImpl(age=30.0, home=Harrow-on-the-Hill, Middlesex, name=Meyer, Mr August, sex=male), PersonImpl(age=48.0, home=Copenhagen, Denmark, name=Milling, Mr Jacob Christian, sex=male), PersonImpl(age=71.0, home=Guernsey / Montclair, NJ and/or Toledo, Ohio, name=Mitchell, Mr Henry Michael, sex=male), PersonImpl(age=54.0, home=Frankfort, KY, name=Moraweck, Dr Ernest, sex=male), PersonImpl(age=64.0, home=Cambridge, MA, name=Myles, Mr Thomas Francis, sex=male), PersonImpl(age=32.0, home=New York, NY, name=Nasser (Nasrallah), Mr Nicholas, sex=male), PersonImpl(age=18.0, home=New York, NY, name=Nasser (Nasrallah), Mrs Nicholas, sex=female), PersonImpl(age=2.0, home=Nice, France, name=Navratil, Master Edmond Roger, sex=male), PersonImpl(age=32.0, home=Nice, France, name=Navratil, Mr Michel, sex=male), PersonImpl(age=3.0, home=Nice, France, name=Navratil, Master Michel M., sex=male), PersonImpl(age=26.0, home=Boston, MA, name=Nesson, Mr Israel, sex=male), PersonImpl(age=19.0, home=Cornwall / Hancock, MI, name=Nicholls, Mr Joseph Charles, sex=male), PersonImpl(age=20.0, home=Cologne, Germany, name=Nourney, Mr Alfred (aka Baron von Drachstedt), sex=male), PersonImpl(age=29.0, home=Folkstone, Kent / New York, NY, name=Nye, Mrs Elizabeth Ramell, sex=female), PersonImpl(age=39.0, home=Middleburg Heights, OH, name=Otter, Mr Richard, sex=male), PersonImpl(age=22.0, home=Pondersend, England / New Durham, NJ, name=Oxenham, Mr Percy Thomas, sex=male), PersonImpl(age=24.0, home=Hamilton, ON, name=Pain, Dr Alfred, sex=male), PersonImpl(age=28.0, home=St Andrews, Guernsey, name=Parker, Mr Clifford R., sex=male), PersonImpl(age=50.0, home=Woodford County, KY, name=Parrish, Mrs Lutie Davis, sex=female), PersonImpl(age=20.0, home=Gunnislake, England / Butte, MT, name=Pengelly, Mr Frederick, sex=male), PersonImpl(age=40.0, home=, name=Peruschitz, Rev. Joseph M., sex=male), PersonImpl(age=42.0, home=Ilfracombe, Devon, name=Phillips, Miss Alice, sex=female), PersonImpl(age=21.0, home=Ilfracombe, Devon, name=Phillips, Mr Robert, sex=male), PersonImpl(age=32.0, home=Russia, name=Pinsky, Miss Rosa, sex=female), PersonImpl(age=34.0, home=Denmark / New York, NY, name=Ponesell, Mr Martin, sex=male), PersonImpl(age=33.0, home=Plymouth, Devon / Detroit, MI, name=Quick, Mrs Frederick C. (Jane Richards), sex=female), PersonImpl(age=2.0, home=Plymouth, Devon / Detroit, MI, name=Quick, Miss Phyllis May, sex=female), PersonImpl(age=8.0, home=Plymouth, Devon / Detroit, MI, name=Quick, Miss Winifred Vera, sex=female), PersonImpl(age=36.0, home=Brighton, Sussex, name=Reeves, Mr David, sex=male), PersonImpl(age=34.0, home=Elizabeth, NJ, name=Renouf, Mr Peter Henry, sex=male), PersonImpl(age=30.0, home=Elizabeth, NJ, name=Renouf, Mrs Peter Henry (Lillian Jefferys), sex=female), PersonImpl(age=28.0, home=Spain, name=Reynaldo, Mrs Encarnacion, sex=female), PersonImpl(age=23.0, home=Paris / Montreal, PQ, name=Richard, Mr Emil, sex=male), PersonImpl(age=0.8333, home=Cornwall / Akron, OH, name=Richards, Master George Sidney, sex=male), PersonImpl(age=25.0, home=Cornwall / Akron, OH, name=Richards, Mrs Sidney (Emily Hocking), sex=female), PersonImpl(age=3.0, home=Cornwall / Akron, OH, name=Richards, Master William Rowe, sex=male), PersonImpl(age=50.0, home=London, England / Marietta, Ohio and Milwaukee, WI, name=Ridsdale, Miss Lucy, sex=female), PersonImpl(age=21.0, home=Guernsey / Wilmington, DE, name=Rugg, Miss Emily, sex=female), PersonImpl(age=25.0, home=Deer Lodge, MT, name=Shelley, Mrs William (Imanita), sex=female), PersonImpl(age=18.0, home=Finland / Minneapolis, MN, name=Silven, Miss Lyyli, sex=female), PersonImpl(age=20.0, home=Cornwall / Hancock, MI, name=Sincock, Miss Maude, sex=female), PersonImpl(age=30.0, home=Finland / Washington, DC, name=Siukonnen, Miss Anna, sex=female), PersonImpl(age=59.0, home=Sault St Marie, ON, name=Sjostedt, Mr Ernst Adolf, sex=male), PersonImpl(age=30.0, home=Halifax, NS, name=Slayter, Miss Hilda Mary, sex=female), PersonImpl(age=35.0, home=Cornwall, name=Slemen, Mr Richard James, sex=male), PersonImpl(age=22.0, home=Newark, NJ, name=Smith (Schmidt), Mr Augustus, sex=male), PersonImpl(age=25.0, home=Cornwall / Houghton, MI, name=Sobey, Mr Hayden, sex=male), PersonImpl(age=41.0, home=New York, NY, name=Stanton, Mr Samuel Ward, sex=male), PersonImpl(age=25.0, home=Catford, Kent / Detroit, MI, name=Stokes, Mr Philip Joseph, sex=male), PersonImpl(age=14.0, home=Somerset / Bernardsville, NJ, name=Sweet, Mr George, sex=male), PersonImpl(age=50.0, home=Indianapolis, IN, name=Toomey, Miss Ellen, sex=female), PersonImpl(age=22.0, home=, name=Troupiansky, Mr Moses Aaron, sex=male), PersonImpl(age=27.0, home=Bath, England / Massachusetts, name=Troutt, Miss Edwina Celia, sex=female), PersonImpl(age=29.0, home=Plymouth, England, name=Turpin, Mr William John, sex=male), PersonImpl(age=27.0, home=Plymouth, England, name=Turpin, Mrs William John (Dorothy Anne Wonnacott), sex=female), PersonImpl(age=30.0, home=Barre, Co Washington, VT, name=Veale, Mr James, sex=male), PersonImpl(age=22.0, home=Antwerp, Belgium / Stanton, OH, name=Waelens, Mr Achille, sex=male), PersonImpl(age=35.0, home=Mamaroneck, NY, name=Walcroft, Miss Nellie, sex=female), PersonImpl(age=30.0, home=Bristol, England / New Britain, CT, name=Ware, Mr John James, sex=male), PersonImpl(age=28.0, home=Bristol, England / New Britain, CT, name=Ware, Mrs John James (Florence Louise Long), sex=female), PersonImpl(age=23.0, home=, name=Ware, Mr William J., sex=male), PersonImpl(age=12.0, home=Aberdeen / Portland, OR, name=Watt, Miss Bertha, sex=female), PersonImpl(age=40.0, home=Aberdeen / Portland, OR, name=Watt, Mrs James (Bessie Inglis Milne), sex=female), PersonImpl(age=36.0, home=England / Hartford, CT, name=Webber, Miss Susan, sex=female), PersonImpl(age=28.0, home=Bromsgrove, England / Montreal, PQ, name=Weisz, Mr Leopold, sex=male), PersonImpl(age=32.0, home=Bromsgrove, England / Montreal, PQ, name=Weisz, Mrs Leopold (Mathilde), sex=female), PersonImpl(age=29.0, home=Cornwall / Akron, OH, name=Wells, Mrs Arthur H. (Addie Trevaskis), sex=female), PersonImpl(age=4.0, home=Cornwall / Akron, OH, name=Wells, Miss Joan, sex=female), PersonImpl(age=2.0, home=Cornwall / Akron, OH, name=Wells, Master Ralph Lester, sex=male), PersonImpl(age=36.0, home=Bournmouth, England, name=West, Mr Edwy Arthur, sex=male), PersonImpl(age=33.0, home=Bournmouth, England, name=West, Mrs Edwy Arthur (Ada Mary), sex=female), PersonImpl(age=32.0, home=London, England, name=Wilhelms, Mr Charles, sex=male), PersonImpl(age=26.0, home=Yoevil, England / Cottage Grove, OR, name=Wright, Miss Marion, sex=female), PersonImpl(age=30.0, home=Bryn Mawr, PA, USA, name=Aldworth, Mr Charles Augustus, sex=male), PersonImpl(age=24.0, home=London / Montreal, PQ, name=Brown, Miss Mildred, sex=female), PersonImpl(age=18.0, home=, name=Swane, Mr George, sex=male), PersonImpl(age=42.0, home=, name=Abbing, Mr Anthony, sex=male), PersonImpl(age=13.0, home=East Providence, RI, name=Abbott, Master Eugene Joseph, sex=male), PersonImpl(age=16.0, home=East Providence, RI, name=Abbott, Mr Rossmore Edward, sex=male), PersonImpl(age=35.0, home=East Providence, RI, name=Abbott, Mrs Stanton (Rosa), sex=female), PersonImpl(age=16.0, home=Norway Los Angeles, CA, name=Abelseth, Miss Anna Karen, sex=female), PersonImpl(age=25.0, home=Perkins County, SD, name=Abelseth, Mr Olaus, sex=male), PersonImpl(age=18.0, home=Greensburg, PA, name=Abraham, Mrs Joseph (Sophie Easu), sex=female), PersonImpl(age=20.0, home=Taalintehdas, Finland Hoboken, NJ, name=Abrahamsson, Mr August, sex=male), PersonImpl(age=30.0, home=Asarum, Sweden Brooklyn, NY, name=Adahl, Mr Mauritz Nils Martin, sex=male), PersonImpl(age=26.0, home=Bournemouth, England, name=Adams, Mr John, sex=male), PersonImpl(age=40.0, home=Sweden Akeley, MN, name=Ahlin, Mrs Johanna Persdotter, sex=female), PersonImpl(age=24.0, home=, name=Ahmed, Mr Ali, sex=male), PersonImpl(age=41.0, home=Finland Sudbury, ON, name=Aijo-Nirva, Mr Isak, sex=male), PersonImpl(age=18.0, home=London, England Norfolk, VA, name=Aks, Mrs Sam (Leah Rosen), sex=female), PersonImpl(age=0.8333, home=London, England Norfolk, VA, name=Aks, Master Philip, sex=male), PersonImpl(age=23.0, home=England Albion, NY, name=Alexander, Mr William, sex=male), PersonImpl(age=20.0, home=Salo, Finland Astoria, OR, name=Alhomaki, Mr Ilmari Rudolf, sex=male), PersonImpl(age=25.0, home=Argentina, name=Ali, Mr William, sex=male), PersonImpl(age=35.0, home=Lower Clapton, Middlesex or Erdington, Birmingham, name=Allen, Mr William Henry, sex=male), PersonImpl(age=17.0, home=Windsor, England New York, NY, name=Allum, Mr Owen George, sex=male), PersonImpl(age=32.0, home=Bergen, Norway, name=Andersen, Mr Albert Karvin, sex=male), PersonImpl(age=20.0, home=Oslo, Norway Cameron, WI, name=Andersen, Mr Thor Olsvigen, sex=male), PersonImpl(age=39.0, home=Sweden Winnipeg, MN, name=Andersson, Mr Anders Johan, sex=male), PersonImpl(age=39.0, home=Sweden Winnipeg, MN, name=Andersson, Mrs Anders Johan (Alfrida K. Brogren), sex=female), PersonImpl(age=6.0, home=Sweden Winnipeg, MN, name=Andersson, Miss Ebba Iris, sex=female), PersonImpl(age=2.0, home=Sweden Winnipeg, MN, name=Andersson, Miss Ellis Anna Maria, sex=female), PersonImpl(age=17.0, home=Ruotsinphyhtaa, Finland New York, NY, name=Andersson, Miss Erna, sex=female), PersonImpl(age=38.0, home=Vadsbro, Sweden Ministee, MI, name=Andersson, Miss Ida Augusta Margareta, sex=female), PersonImpl(age=9.0, home=Sweden Winnipeg, MN, name=Andersson, Miss Ingeborg Constancia, sex=female), PersonImpl(age=26.0, home=Hartford, CT, name=Andersson, Mr Johan Samuel, sex=male), PersonImpl(age=11.0, home=Sweden Winnipeg, MN, name=Andersson, Miss Sigrid Elizabeth, sex=female), PersonImpl(age=4.0, home=Sweden Winnipeg, MN, name=Andersson, Master Sigvard Harald Elias, sex=male), PersonImpl(age=20.0, home=Sweden Chicago, IL, name=Andreasson, Mr Paul Edvin, sex=male), PersonImpl(age=26.0, home=Bulgaria Chicago, IL, name=Angheloff, Mr Minko, sex=male), PersonImpl(age=25.0, home=Altdorf, Switzerland, name=Arnold, Mr Josef, sex=male), PersonImpl(age=18.0, home=Altdorf, Switzerland, name=Arnold, Mrs Josef (Josephine Frank), sex=female), PersonImpl(age=24.0, home=Sweden Joliet, IL, name=Aronsson, Mr Ernst Axel Algot, sex=male), PersonImpl(age=35.0, home=, name=Asim, Mr Adola, sex=male), PersonImpl(age=40.0, home=Sweden Worcester, MA, name=Asplund, Mr Carl Oscar Vilhelm Gustafsson, sex=male), PersonImpl(age=38.0, home=Sweden Worcester, MA, name=Asplund, Mrs Carl Oscar (Selma Augusta Johansson), sex=female), PersonImpl(age=5.0, home=Sweden Worcester, MA, name=Asplund, Master Carl Edgar, sex=male), PersonImpl(age=9.0, home=Sweden Worcester, MA, name=Asplund, Master Clarence Gustaf Hugo, sex=male), PersonImpl(age=3.0, home=Sweden Worcester, MA, name=Aspland, Master Edvin Rojj Felix, sex=male), PersonImpl(age=13.0, home=Sweden Worcester, MA, name=Asplund, Master Filip Oscar, sex=male), PersonImpl(age=23.0, home=Oskarshamn, Sweden Minneapolis, MN, name=Asplund, Mr John Charles, sex=male), PersonImpl(age=5.0, home=Sweden Worcester, MA, name=Asplund, Miss Lillian Gertrud, sex=female), PersonImpl(age=45.0, home=Ottawa, ON, name=Assaf, Mrs Mariana, sex=female), PersonImpl(age=23.0, home=, name=Assam, Mr Ali, sex=male), PersonImpl(age=17.0, home=, name=Attalah, Miss Malaka, sex=female), PersonImpl(age=27.0, home=Ottawa, ON, name=Attala (Kalil), Mr Solomon, sex=male), PersonImpl(age=23.0, home=Krakoryd, Sweden Bloomington, IL, name=Augustsson, Mr Albert, sex=male), PersonImpl(age=20.0, home=, name=Baccos, Mr Rafoul, sex=male), PersonImpl(age=32.0, home=Ruotsinphytaa, Finland New York, NY, name=Backstrom, Mr Karl Alfred, sex=male), PersonImpl(age=33.0, home=Ruotsinphytaa, Finland New York, NY, name=Backstrom, Mrs Karl Alfred (Maria Mathilda Gustafsson), sex=female), PersonImpl(age=3.0, home=Syria New York, NY, name=Baclini, Miss Eugenie, sex=female), PersonImpl(age=18.0, home=London Skanteales, NY, name=Badman, Miss Emily Louisa, sex=female), PersonImpl(age=40.0, home=, name=Badt, Mr Mohamed, sex=male), PersonImpl(age=26.0, home=, name=Balkic, Mr Cerin, sex=male), PersonImpl(age=15.0, home=Syria Youngstown, OH, name=Banoura, Miss Ayout, sex=female), PersonImpl(age=45.0, home=Syria Ottawa, ON, name=Barbara, Mrs Catherine, sex=female), PersonImpl(age=18.0, home=Syria Ottawa, ON, name=Barbara, Miss Saude, sex=female), PersonImpl(age=27.0, home=New York, NY, name=Barry, Miss Julia, sex=female), PersonImpl(age=22.0, home=England New York, NY, name=Barton Mr David, sex=male), PersonImpl(age=19.0, home=England, name=Beavan, Mr William Thomas, sex=male), PersonImpl(age=26.0, home=Krakudden, Sweden Moune, IL, name=Bengtsson, Mr John Viktor, sex=male), PersonImpl(age=22.0, home=Tranvik, Finland New York, name=Berglund. Mr Karl Ivar Sven, sex=male), PersonImpl(age=20.0, home=Syria, name=Betros, Mr Tannous, sex=male), PersonImpl(age=32.0, home=Hong Kong New York, NY, name=Bing, Mr Lee, sex=male), PersonImpl(age=21.0, home=Brennes, Norway New York, name=Birkeland, Mr Hans, sex=male), PersonImpl(age=18.0, home=Stockholm, Sweden New York, name=Bjorklund, Ernst Herbert, sex=male), PersonImpl(age=26.0, home=Bulgaria Chicago, IL, name=Bostandyeff, Mr Guentcho, sex=male), PersonImpl(age=6.0, home=Syria Kent, ON, name=Boulos, Master Akar, sex=male), PersonImpl(age=9.0, home=Syria Kent, ON, name=Boulos, Miss Laura, sex=female), PersonImpl(age=40.0, home=Ireland Chicago, IL, name=Bourke, Mr John, sex=male), PersonImpl(age=32.0, home=Ireland Chicago, IL, name=Bourke, Mrs John (Catherine), sex=female), PersonImpl(age=26.0, home=Treherbert, Cardiff, Wales, name=Bowen, Mr David, sex=male), PersonImpl(age=18.0, home=Kingwilliamstown, Co Cork, Ireland Glens Falls, NY, name=Bradley, Miss Bridget Delia, sex=female), PersonImpl(age=20.0, home=Medeltorp, Sweden Chicago, IL, name=Braf, Miss Elin Ester Maria, sex=female), PersonImpl(age=29.0, home=Bridgerule, Devon, name=Braund, Mr Lewis Richard, sex=male), PersonImpl(age=22.0, home=Bridgerule, Devon, name=Braund, Mr Owen Harris, sex=male), PersonImpl(age=22.0, home=Sweden Worcester, MA, name=Brobek, Mr Karl Rudolf, sex=male), PersonImpl(age=35.0, home=Broomfield, Chelmsford, England, name=Brocklebank, Mr William Alfred, sex=male), PersonImpl(age=21.0, home=Kingwilliamstown, Co Cork, Ireland New York, NY, name=Buckley, Mr Daniel, sex=male), PersonImpl(age=20.0, home=Co Cork, Ireland Roxbury, MA, name=Buckley, Miss Katherine, sex=female), PersonImpl(age=19.0, home=Co Cork, Ireland Charlestown, MA, name=Burke, Mr Jeremiah, sex=male), PersonImpl(age=18.0, home=Co Sligo, Ireland New York, NY, name=Burns, Miss Mary Delia, sex=female), PersonImpl(age=18.0, home=Croatia, name=Cacic, Mr Grego, sex=male), PersonImpl(age=38.0, home=Croatia, name=Cacic, Mr Luka, sex=male), PersonImpl(age=30.0, home=Croatia, name=Cacic, Mr Maria, sex=male), PersonImpl(age=17.0, home=, name=Calic, Mr Peter, sex=male), PersonImpl(age=21.0, home=, name=Canavan, Miss Mary, sex=female), PersonImpl(age=21.0, home=Ireland Philadelphia, PA, name=Canavan, Mr Patrick, sex=male), PersonImpl(age=21.0, home=, name=Cann, Mr Ernest, sex=male), PersonImpl(age=24.0, home=Goteborg, Sweden Huntley, IL, name=Carlsson, Mr Carl Robert, sex=male), PersonImpl(age=33.0, home=New York, NY, name=Carlsson, Mr Frans Olof, sex=male), PersonImpl(age=33.0, home=, name=Carlsson, Mr Julius, sex=male), PersonImpl(age=28.0, home=Dagsas, Sweden Fower, MN, name=Carlsson, Mr August Sigfrid, sex=male), PersonImpl(age=16.0, home=Co Longford, Ireland New York, NY, name=Carr, Miss Helen, sex=female), PersonImpl(age=37.0, home=Co Sligo, Ireland Hartford, CT, name=Carr, Miss Jeannie, sex=female), PersonImpl(age=28.0, home=St Denys, Southampton, Hants, name=Carver, Mr Alfred John, sex=male), PersonImpl(age=24.0, home=London, name=Celotti, Mr Francesco, sex=male), PersonImpl(age=21.0, home=Ireland New York, NY, name=Chartens, Mr David, sex=male), PersonImpl(age=32.0, home=Hong Kong New York, NY, name=Chip, Mr Chang, sex=male), PersonImpl(age=29.0, home=, name=Christmann, Mr Emil, sex=male), PersonImpl(age=26.0, home=Greece, name=Chronopoulos, Mr Apostolos, sex=male), PersonImpl(age=18.0, home=Greece, name=Chronopoulos, Mr Demetrios, sex=male), PersonImpl(age=20.0, home=Portugal, name=Coelho, Mr Domingos Fernandes, sex=male), PersonImpl(age=19.0, home=London Brooklyn, NY, name=Cohen, Mr Gurshon (Gus), sex=male), PersonImpl(age=24.0, home=Co Limerick, Ireland Sherbrooke, PQ, name=Colbert, Mr Patrick, sex=male), PersonImpl(age=24.0, home=, name=Coleff, Mr Fotio, sex=male), PersonImpl(age=36.0, home=Bulgaria Chicago, IL, name=Coleff, Mr Peyo, sex=male), PersonImpl(age=31.0, home=Philadelphia, PA, name=Conlin, Mr Thomas Henry, sex=male), PersonImpl(age=31.0, home=Ireland Brooklyn, NY, name=Connaghton, Mr Michael, sex=male), PersonImpl(age=30.0, home=Ireland, name=Connolly, Miss Kate, sex=female), PersonImpl(age=22.0, home=Ireland, name=Connolly, Miss Kate, sex=female), PersonImpl(age=43.0, home=, name=Cook, Mr Jacob, sex=male), PersonImpl(age=35.0, home=Austria, name=Cor, Mr Bartol, sex=male), PersonImpl(age=27.0, home=Austria, name=Cor, Mr Ivan, sex=male), PersonImpl(age=19.0, home=Austria, name=Cor, Mr Ludovik, sex=male), PersonImpl(age=30.0, home=London, name=Corn, Mr Harry, sex=male), PersonImpl(age=36.0, home=England Brooklyn, NY, name=Coutts, Mrs William (Minnie), sex=female), PersonImpl(age=3.0, home=England Brooklyn, NY, name=Coutts, Master Neville, sex=male), PersonImpl(age=9.0, home=England Brooklyn, NY, name=Coutts, Master William Leslie, sex=male), PersonImpl(age=59.0, home=Merrill, WI, name=Coxon, Mr Daniel, sex=male), PersonImpl(age=19.0, home=Bristol, England Cleveland, OH, name=Crease, Mr Ernest James, sex=male), PersonImpl(age=44.0, home=Bournemouth, England Newark, NJ, name=Cribb, Mr John Hatfield, sex=male), PersonImpl(age=17.0, home=Bournemouth, England Newark, NJ, name=Cribb, Miss Laura Alice, sex=female), PersonImpl(age=45.0, home=Australia Fingal, ND, name=Dahl, Mr Charles Edward, sex=male), PersonImpl(age=22.0, home=Norrlot, Sweden Chicago, IL, name=Dahlberg, Miss Gerda Ulrika, sex=female), PersonImpl(age=19.0, home=Austria, name=Dakic, Mr Branko, sex=male), PersonImpl(age=29.0, home=Co Athlone, Ireland New York, NY, name=Daly, Mr Eugene, sex=male), PersonImpl(age=30.0, home=Co Athlone, Ireland New York, NY, name=Daly, Miss Marcella, sex=female), PersonImpl(age=34.0, home=Stanton, IA, name=Danbom, Mr Ernst Gilbert, sex=male), PersonImpl(age=28.0, home=Stanton, IA, name=Danbom, Mrs Ernst Gilbert (Anna Sigrid Maria Brogren), sex=female), PersonImpl(age=0.3333, home=Stanton, IA, name=Danbom, Master Gilbert Sigvard Emanuel, sex=male), PersonImpl(age=27.0, home=Bulgaria Chicago, IL, name=Danoff, Mr Yoto, sex=male), PersonImpl(age=25.0, home=Bulgaria Chicago, IL, name=Dantchoff, Mr Khristo, sex=male), PersonImpl(age=24.0, home=West Bromwich, England Pontiac, MI, name=Davies, Mr Alfred, sex=male), PersonImpl(age=22.0, home=, name=Davies, Mr Evan, sex=male), PersonImpl(age=21.0, home=West Bromwich, England Pontiac, MI, name=Davies, Mr John, sex=male), PersonImpl(age=17.0, home=West Bromwich, England Pontiac, MI, name=Davies, Mr Joseph, sex=male), PersonImpl(age=26.0, home=Devon, England Wichita, KS, name=Dean, Mr Bertram, sex=male), PersonImpl(age=33.0, home=Devon, England Wichita, KS, name=Dean, Mrs Bertram (Eva), sex=female), PersonImpl(age=1.0, home=Devon, England Wichita, KS, name=Dean, Master Bertram Vere, sex=male), PersonImpl(age=0.1667, home=Devon, England Wichita, KS, name=Dean, Miss Elizabeth Gladys (Millvena), sex=female), PersonImpl(age=25.0, home=, name=Delalic, Mr Regyo, sex=male), PersonImpl(age=36.0, home=Tampico, MT, name=De Messemaeker, Mr William Joseph, sex=male), PersonImpl(age=36.0, home=Tampico, MT, name=De Messemaeker, Mrs William Joseph (Anna), sex=female), PersonImpl(age=30.0, home=Belgium Detroit, MI, name=De Mulder, Mr Theo, sex=male), PersonImpl(age=23.0, home=, name=Dennis, Mr Samuel, sex=male), PersonImpl(age=26.0, home=, name=Dennis, Mr William, sex=male), PersonImpl(age=19.0, home=Kilmacowen, Co Sligo, Ireland New York, NY, name=Devaney, Miss Margaret, sex=female), PersonImpl(age=65.0, home=, name=Dewan, Mr Frank, sex=male), PersonImpl(age=42.0, home=, name=Dimic, Mr Jovan, sex=male), PersonImpl(age=43.0, home=, name=Dintcheff, Mr Valtcho, sex=male), PersonImpl(age=32.0, home=Ireland New York, NY, name=Dooley, Mr Patrick, sex=male), PersonImpl(age=19.0, home=England Oglesby, IL, name=Dorkings, Mr Edward Arthur, sex=male), PersonImpl(age=30.0, home=Union Hill, NJ, name=Dowdell, Miss Elizabeth, sex=female), PersonImpl(age=24.0, home=Ireland New York, NY, name=Doyle, Miss Elizabeth, sex=female), PersonImpl(age=23.0, home=London New York, NY, name=Drapkin, Miss Jennie, sex=female), PersonImpl(age=24.0, home=Ballydehob, Co Cork, Ireland New York, NY, name=Driscoll, Miss Bridget, sex=female), PersonImpl(age=24.0, home=England Albion, NY, name=Duquemin, Mr Joseph, sex=male), PersonImpl(age=23.0, home=West Haven, CT, name=Dyker, Mr Adolf Fredrik, sex=male), PersonImpl(age=22.0, home=West Haven, CT, name=Dyker, Mrs Adolf Fredrik (Anna Elizabeth Judith Andersson), sex=female), PersonImpl(age=18.0, home=Tofta, Sweden Joliet, IL, name=Edvardsson, Mr Gustaf Hjalmar, sex=male), PersonImpl(age=16.0, home=Karberg, Sweden Jerome Junction, AZ, name=Eklund, Mr Hans Linus, sex=male), PersonImpl(age=45.0, home=Effington Rut, SD, name=Ekstrom, Mr Johan, sex=male), PersonImpl(age=47.0, home=Illinois, USA, name=Elsbury, Mr James, sex=male), PersonImpl(age=5.0, home=New York, NY, name=Emanuel, Miss Virginia Ethel, sex=female), PersonImpl(age=21.0, home=Rotherfield, Sussex, England Essex Co, MA, name=Ford, Miss Doolina Margaret, sex=female), PersonImpl(age=18.0, home=Rotherfield, Sussex, England Essex Co, MA, name=Ford, Mr Edward Watson, sex=male), PersonImpl(age=9.0, home=Rotherfield, Sussex, England Essex Co, MA, name=Ford, Miss Maggie, sex=female), PersonImpl(age=48.0, home=Rotherfield, Sussex, England Essex Co, MA, name=Ford, Mrs Edward (Margaret Ann), sex=female), PersonImpl(age=16.0, home=Rotherfield, Sussex, England Essex Co, MA, name=Ford, Mr Neil Watson, sex=male), PersonImpl(age=25.0, home=New York, NY, name=Gallagher, Mr Martin, sex=male), PersonImpl(age=22.0, home=, name=Gilinski, Mr Leslie, sex=male), PersonImpl(age=16.0, home=Co Longford, Ireland New York, NY, name=Gilnagh, Miss Katie, sex=female), PersonImpl(age=33.0, home=Strood, Kent, England Detroit, MI, name=Goldsmith, Mr Frank John, sex=male), PersonImpl(age=9.0, home=Strood, Kent, England Detroit, MI, name=Goldsmith, Master Frank John William, sex=male), PersonImpl(age=41.0, home=Philadelphia, PA, name=Goldsmith, Mr Nathan, sex=male), PersonImpl(age=38.0, home=Portugal, name=Goncalves, Mr Manuel Estanslas, sex=male), PersonImpl(age=40.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Mr Frederick, sex=male), PersonImpl(age=43.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Mrs Frederick (Augusta), sex=female), PersonImpl(age=14.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Mr Charles E., sex=male), PersonImpl(age=16.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Miss Lillian A., sex=female), PersonImpl(age=9.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Master Harold V., sex=male), PersonImpl(age=10.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Miss Jessie A., sex=female), PersonImpl(age=6.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Master Sidney L., sex=male), PersonImpl(age=11.0, home=Wiltshire, England Niagara Falls, NY, name=Goodwin, Master William F., sex=male), PersonImpl(age=40.0, home=Dorking, Surrey, England, name=Green, Mr George, sex=male), PersonImpl(age=32.0, home=Foresvik, Norway Portland, ND, name=Gronnestad, Mr Daniel Danielsen, sex=male), PersonImpl(age=20.0, home=Waukegan, Chicago, IL, name=Gustafsson, Mr Alfred Ossian, sex=male), PersonImpl(age=37.0, home=Ruotsinphytaa, Finland New York, NY, name=Gustafsson, Mr Anders Vilhelm, sex=male), PersonImpl(age=28.0, home=Ruotsinphytaa, Finland New York, NY, name=Gustafsson, Mr Johan Birger, sex=male), PersonImpl(age=19.0, home=Myren, Sweden New York, NY, name=Gustafsson, Mr Karl Gideon, sex=male)]" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "persons" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Column-based polymorphism" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
namesex
Allen, Miss Elisabeth Waltonfemale
Allison, Miss Helen Lorainefemale
Allison, Mr Hudson Joshua Creightonmale
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)female
Allison, Master Hudson Trevormale
Anderson, Mr Harrymale
Andrews, Miss Kornelia Theodosiafemale
Andrews, Mr Thomas, jrmale
Appleton, Mrs Edward Dale (Charlotte Lamson)female
Artagaveytia, Mr Ramonmale
Astor, Colonel John Jacobmale
Astor, Mrs John Jacob (Madeleine Talmadge Force)female
Aubert, Mrs Leontine Paulinefemale
Barkworth, Mr Algernon H.male
Baumann, Mr John D.male
Baxter, Mrs James (Helene DeLaudeniere Chaput)female
Baxter, Mr Quigg Edmondmale
Beattie, Mr Thomsonmale
Beckwith, Mr Richard Leonardmale
Beckwith, Mrs Richard Leonard (Sallie Monypeny)female

... only showing top 20 rows

" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// When data frame variable is mutable, a strongly typed wrapper for it \n", "// is generated only once after the first execution of a cell where it is declared\n", "var nameAndSex = df.select(df.name, df.sex)\n", "nameAndSex" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
pclassnameembarkedhomeroomticketboatsex
1stAllen, Miss Elisabeth WaltonSouthamptonSt Louis, MOB-524160 L2212female
1stAllison, Miss Helen LoraineSouthamptonMontreal, PQ / Chesterville, ONC26female
1stAllison, Mr Hudson Joshua CreightonSouthamptonMontreal, PQ / Chesterville, ONC26(135)male
1stAllison, Mrs Hudson J.C. (Bessie Waldo Daniels)SouthamptonMontreal, PQ / Chesterville, ONC26female
1stAllison, Master Hudson TrevorSouthamptonMontreal, PQ / Chesterville, ONC2211male
1stAnderson, Mr HarrySouthamptonNew York, NYE-123male
1stAndrews, Miss Kornelia TheodosiaSouthamptonHudson, NYD-713502 L7710female
1stAndrews, Mr Thomas, jrSouthamptonBelfast, NIA-36male
1stAppleton, Mrs Edward Dale (Charlotte Lamson)SouthamptonBayside, Queens, NYC-1012female
1stArtagaveytia, Mr RamonCherbourgMontevideo, Uruguay(22)male
1stAstor, Colonel John JacobCherbourgNew York, NY17754 L224 10s 6d(124)male
1stAstor, Mrs John Jacob (Madeleine Talmadge Force)CherbourgNew York, NY17754 L224 10s 6d4female
1stAubert, Mrs Leontine PaulineCherbourgParis, FranceB-3517477 L69 6s9female
1stBarkworth, Mr Algernon H.SouthamptonHessle, YorksA-23Bmale
1stBaumann, Mr John D.SouthamptonNew York, NYmale
1stBaxter, Mrs James (Helene DeLaudeniere Chaput)CherbourgMontreal, PQB-58/606female
1stBaxter, Mr Quigg EdmondCherbourgMontreal, PQB-58/60male
1stBeattie, Mr ThomsonCherbourgWinnipeg, MNC-6male
1stBeckwith, Mr Richard LeonardSouthamptonNew York, NYD-355male
1stBeckwith, Mrs Richard Leonard (Sallie Monypeny)SouthamptonNew York, NYD-355female

... only showing top 20 rows

" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// let's declare immutable variable, that contains all string columns\n", "val strings = df.selectIf{valueClass == String::class}\n", "strings" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
pclassnameembarkedhomeroomticketboatsex
1stAllen, Miss Elisabeth WaltonSouthamptonSt Louis, MOB-524160 L2212female
1stAllison, Miss Helen LoraineSouthamptonMontreal, PQ / Chesterville, ONC26female
1stAllison, Mr Hudson Joshua CreightonSouthamptonMontreal, PQ / Chesterville, ONC26(135)male
1stAllison, Mrs Hudson J.C. (Bessie Waldo Daniels)SouthamptonMontreal, PQ / Chesterville, ONC26female
1stAllison, Master Hudson TrevorSouthamptonMontreal, PQ / Chesterville, ONC2211male
1stAnderson, Mr HarrySouthamptonNew York, NYE-123male
1stAndrews, Miss Kornelia TheodosiaSouthamptonHudson, NYD-713502 L7710female
1stAndrews, Mr Thomas, jrSouthamptonBelfast, NIA-36male
1stAppleton, Mrs Edward Dale (Charlotte Lamson)SouthamptonBayside, Queens, NYC-1012female
1stArtagaveytia, Mr RamonCherbourgMontevideo, Uruguay(22)male
1stAstor, Colonel John JacobCherbourgNew York, NY17754 L224 10s 6d(124)male
1stAstor, Mrs John Jacob (Madeleine Talmadge Force)CherbourgNew York, NY17754 L224 10s 6d4female
1stAubert, Mrs Leontine PaulineCherbourgParis, FranceB-3517477 L69 6s9female
1stBarkworth, Mr Algernon H.SouthamptonHessle, YorksA-23Bmale
1stBaumann, Mr John D.SouthamptonNew York, NYmale
1stBaxter, Mrs James (Helene DeLaudeniere Chaput)CherbourgMontreal, PQB-58/606female
1stBaxter, Mr Quigg EdmondCherbourgMontreal, PQB-58/60male
1stBeattie, Mr ThomsonCherbourgWinnipeg, MNC-6male
1stBeckwith, Mr Richard LeonardSouthamptonNew York, NYD-355male
1stBeckwith, Mrs Richard Leonard (Sallie Monypeny)SouthamptonNew York, NYD-355female

... only showing top 20 rows

" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// 'nameAndSex' is assignable from 'strings', \n", "// because 'strings' has all the columns that are required by type of 'nameAndSex'\n", "nameAndSex = strings\n", "\n", "// note, that the actual value of 'nameAndSex' is still a data frame of all string columns\n", "nameAndSex" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "sex [Str][1313]: female, female, male, female, male, male, female, male, female, male, male, female,..." ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// but typed access to the fields works only for 'name' and 'sex'\n", "nameAndSex.sex // this is OK" ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Type mismatch: inferred type is TypedDataFrame but TypedDataFrame was expected" ] } ], "source": [ "nameAndSex.home // this fails with compilation error" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "home [Str][1313]: St Louis, MO, Montreal, PQ / Chesterville, ON, Montreal, PQ / Chesterville, ON, Mo..." ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nameAndSex[\"home\"] // the requested column is still available by column name string" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
namehome
Allen, Miss Elisabeth WaltonSt Louis, MO
Allison, Miss Helen LoraineMontreal, PQ / Chesterville, ON
Allison, Mr Hudson Joshua CreightonMontreal, PQ / Chesterville, ON
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels)Montreal, PQ / Chesterville, ON
Allison, Master Hudson TrevorMontreal, PQ / Chesterville, ON
Anderson, Mr HarryNew York, NY
Andrews, Miss Kornelia TheodosiaHudson, NY
Andrews, Mr Thomas, jrBelfast, NI
Appleton, Mrs Edward Dale (Charlotte Lamson)Bayside, Queens, NY
Artagaveytia, Mr RamonMontevideo, Uruguay
Astor, Colonel John JacobNew York, NY
Astor, Mrs John Jacob (Madeleine Talmadge Force)New York, NY
Aubert, Mrs Leontine PaulineParis, France
Barkworth, Mr Algernon H.Hessle, Yorks
Baumann, Mr John D.New York, NY
Baxter, Mrs James (Helene DeLaudeniere Chaput)Montreal, PQ
Baxter, Mr Quigg EdmondMontreal, PQ
Beattie, Mr ThomsonWinnipeg, MN
Beckwith, Mr Richard LeonardNew York, NY
Beckwith, Mrs Richard Leonard (Sallie Monypeny)New York, NY

... only showing top 20 rows

" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// now let's create a variable with two other columns\n", "val nameAndHome = df.select(df.name, df.home)\n", "nameAndHome" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Type mismatch: inferred type is TypedDataFrame but TypedDataFrame was expected" ] } ], "source": [ "nameAndSex = nameAndHome // this assignment doesn't work because of columns mismatch" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "// unfortunately, there is a way to get a runtime error here, \n", "// because typed wrappers are generated only after execution of a cell\n", "\n", "// so the following assigment will pass fine, because return type of 'select' is the same as in 'df' variable, \n", "// although the set of columns was reduced\n", "nameAndSex = df.select(df.name, df.home) " ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "java.util.NoSuchElementException: Could not find column 'sex' in dataframe\n", "krangl.SimpleDataFrame.get(SimpleDataFrame.kt:129)\n", "krangl.typed.TypedDataFrame$DefaultImpls.get(TypedDataFrame.kt:43)\n", "krangl.typed.TypedDataFrameImpl.get(TypedDataFrame.kt:73)\n", "Line_184_jupyter.getSex(Unknown Source)\n", "Line_227_jupyter.(Unknown Source)\n", "java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n", "java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n", "java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n", "java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)\n", "kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.evalWithConfigAndOtherScriptsResults(BasicJvmScriptEvaluator.kt:95)\n", "kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke$suspendImpl(BasicJvmScriptEvaluator.kt:40)\n", "kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke(BasicJvmScriptEvaluator.kt)\n", "kotlin.script.experimental.jvmhost.repl.JvmReplEvaluator$eval$$inlined$write$lambda$2.invokeSuspend(legacyReplEvaluation.kt:57)\n", "kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:80)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)\n", "org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)\n", "kotlin.script.experimental.jvmhost.repl.JvmReplEvaluator.eval(legacyReplEvaluation.kt:57)\n", "org.jetbrains.kotlin.cli.common.repl.ReplEvalAction$DefaultImpls.eval$default(ReplApi.kt:123)\n", "org.jetbrains.kotlin.jupyter.ReplForJupyterImpl.doEval(repl.kt:429)\n", "org.jetbrains.kotlin.jupyter.ReplForJupyterImpl.eval(repl.kt:349)\n", "org.jetbrains.kotlin.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:91)\n", "org.jetbrains.kotlin.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt)\n", "org.jetbrains.kotlin.jupyter.ProtocolKt.evalWithIO(protocol.kt:252)\n", "org.jetbrains.kotlin.jupyter.ProtocolKt.shellMessagesHandler(protocol.kt:90)\n", "org.jetbrains.kotlin.jupyter.IkotlinKt.kernelServer(ikotlin.kt:104)\n", "org.jetbrains.kotlin.jupyter.IkotlinKt.main(ikotlin.kt:59)\n" ] } ], "source": [ "// if we try to access the column, we get runtime error\n", "nameAndSex.sex " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## TODO" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Support operations:\n", "* Add row\n", "* Join\n", "* Reshape\n", "\n", "Improve typed wrappers for:\n", "* Grouped data frame\n", "* Columns" ] } ], "metadata": { "kernelspec": { "display_name": "Kotlin", "language": "kotlin", "name": "kotlin" }, "language_info": { "codemirror_mode": "text/x-kotlin", "file_extension": ".kt", "mimetype": "text/x-kotlin", "name": "kotlin", "pygments_lexer": "kotlin", "version": "1.4.0-dev-7568" } }, "nbformat": 4, "nbformat_minor": 2 }