%use dataframe, khttp
// to see autogenerated code, uncomment the line below:
//%trackExecution -generated
val response = khttp.get("http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic.txt")
val cleanedText = response.text.replace("\"Molly\"", "Molly").replace("row.names", "row").replace("home.dest", "home")
// convert data to dataframe, generate marker interface for typed data frame wrapper and extension properties for it
val df = DataFrame.readDelim(cleanedText.byteInputStream())
df
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
13 | 1st | 1 | Aubert, Mrs Leontine Pauline | null | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
14 | 1st | 1 | Barkworth, Mr Algernon H. | null | Southampton | Hessle, Yorks | A-23 | B | male | |
15 | 1st | 0 | Baumann, Mr John D. | null | Southampton | New York, NY | male | |||
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female |
... only showing top 20 rows
// get typed column as extension property
df.name
name [Str][1313]: Allen, Miss Elisabeth Walton, Allison, Miss Helen Loraine, Allison, Mr Hudson Josh...
// select single column -> returns DataFrame
df.select{name}
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
// select several columns
df.select{columns(name, age, embarked)}
name | age | embarked |
---|---|---|
Allen, Miss Elisabeth Walton | 29.0 | Southampton |
Allison, Miss Helen Loraine | 2.0 | Southampton |
Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton |
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton |
Allison, Master Hudson Trevor | 0.9167 | Southampton |
Anderson, Mr Harry | 47.0 | Southampton |
Andrews, Miss Kornelia Theodosia | 63.0 | Southampton |
Andrews, Mr Thomas, jr | 39.0 | Southampton |
Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton |
Artagaveytia, Mr Ramon | 71.0 | Cherbourg |
Astor, Colonel John Jacob | 47.0 | Cherbourg |
Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg |
Aubert, Mrs Leontine Pauline | null | Cherbourg |
Barkworth, Mr Algernon H. | null | Southampton |
Baumann, Mr John D. | null | Southampton |
Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg |
Baxter, Mr Quigg Edmond | 24.0 | Cherbourg |
Beattie, Mr Thomson | 36.0 | Cherbourg |
Beckwith, Mr Richard Leonard | 37.0 | Southampton |
Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton |
... only showing top 20 rows
// another way to select columns without compile-time check
df.select(df.name, df.age, df.sex)
name | age | sex |
---|---|---|
Allen, Miss Elisabeth Walton | 29.0 | female |
Allison, Miss Helen Loraine | 2.0 | female |
Allison, Mr Hudson Joshua Creighton | 30.0 | male |
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | female |
Allison, Master Hudson Trevor | 0.9167 | male |
Anderson, Mr Harry | 47.0 | male |
Andrews, Miss Kornelia Theodosia | 63.0 | female |
Andrews, Mr Thomas, jr | 39.0 | male |
Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | female |
Artagaveytia, Mr Ramon | 71.0 | male |
Astor, Colonel John Jacob | 47.0 | male |
Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | female |
Aubert, Mrs Leontine Pauline | null | female |
Barkworth, Mr Algernon H. | null | male |
Baumann, Mr John D. | null | male |
Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | female |
Baxter, Mr Quigg Edmond | 24.0 | male |
Beattie, Mr Thomson | 36.0 | male |
Beckwith, Mr Richard Leonard | 37.0 | male |
Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | female |
... only showing top 20 rows
// select columns filtered by predicate
df.selectIf{valueClass == String::class}
pclass | name | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|
1st | Allen, Miss Elisabeth Walton | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
1st | Allison, Miss Helen Loraine | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1st | Allison, Mr Hudson Joshua Creighton | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | |
1st | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1st | Allison, Master Hudson Trevor | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
1st | Anderson, Mr Harry | Southampton | New York, NY | E-12 | 3 | male | |
1st | Andrews, Miss Kornelia Theodosia | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
1st | Andrews, Mr Thomas, jr | Southampton | Belfast, NI | A-36 | male | ||
1st | Appleton, Mrs Edward Dale (Charlotte Lamson) | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
1st | Artagaveytia, Mr Ramon | Cherbourg | Montevideo, Uruguay | (22) | male | ||
1st | Astor, Colonel John Jacob | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | |
1st | Astor, Mrs John Jacob (Madeleine Talmadge Force) | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
1st | Aubert, Mrs Leontine Pauline | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
1st | Barkworth, Mr Algernon H. | Southampton | Hessle, Yorks | A-23 | B | male | |
1st | Baumann, Mr John D. | Southampton | New York, NY | male | |||
1st | Baxter, Mrs James (Helene DeLaudeniere Chaput) | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
1st | Baxter, Mr Quigg Edmond | Cherbourg | Montreal, PQ | B-58/60 | male | ||
1st | Beattie, Mr Thomson | Cherbourg | Winnipeg, MN | C-6 | male | ||
1st | Beckwith, Mr Richard Leonard | Southampton | New York, NY | D-35 | 5 | male | |
1st | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | Southampton | New York, NY | D-35 | 5 | female |
... only showing top 20 rows
// Row indexing
df[1]
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female |
// Column indexing
df.name[0]
Allen, Miss Elisabeth Walton
// Same result
df[0].name
Allen, Miss Elisabeth Walton
// filter rows by predicate. Predicate receiver is of type TypedDataFrameRow<*> with generated extension properties
df.filter {sex == "female"}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
13 | 1st | 1 | Aubert, Mrs Leontine Pauline | null | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | |
24 | 1st | 1 | Bishop, Mrs Dickinson H. (Helen Walton) | 19.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | female | |
28 | 1st | 1 | Bonnell, Miss Caroline | 30.0 | Southampton | Youngstown, OH | C-7 | 8 | female | |
29 | 1st | 1 | Bonnell, Miss Elizabeth | 58.0 | Southampton | Birkdale, England Cleveland, Ohio | C-103 | 8 | female | |
31 | 1st | 1 | Bowen, Miss Grace Scott | 45.0 | Cherbourg | Cooperstown, NY | 4 | female | ||
32 | 1st | 1 | Bowerman, Miss Elsie Edith | 22.0 | Southampton | St Leonards-on-Sea, England Ohio | 6 | female | ||
37 | 1st | 1 | Brown, Mrs James Joseph (Margaret Molly Tobin) | 44.0 | Cherbourg | Denver, CO | 17610 L27 15s 5d | 6 | female | |
38 | 1st | 1 | Brown, Mrs John Murray (Caroline Lane Lamson) | 59.0 | Southampton | Belmont, MA | C-101 | D | female | |
39 | 1st | 1 | Bucknell, Mrs William Robert (Emma Eliza Ward) | 60.0 | Cherbourg | Philadelphia, PA | 8 | female | ||
42 | 1st | 1 | Candee, Mrs Edward (Helen Churchill Hungerford) | 53.0 | Cherbourg | Washington, DC | 6 | female | ||
43 | 1st | 1 | Cardeza, Mrs James Warburton Martinez (Charlott... | 58.0 | Cherbourg | Germantown, Philadelphia, PA | B-51/3/5 | 17755 L512 6s | 3 | female |
49 | 1st | 1 | Carter, Mrs William Ernest (Lucile Polk) | 36.0 | Southampton | Bryn Mawr, PA | 4 | female |
... only showing top 20 rows
df.filter { age > 50 } // compilation error, because 'age' is a nullable property
Operator call corresponds to a dot-qualified call 'age.compareTo(50)' which is not allowed on a nullable receiver 'age'.
// filter rows where 'age' is not null.
val withAges = df.filterNotNull {age}
withAges
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | |
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | |
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | ||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male |
... only showing top 20 rows
// now filtration works
withAges.filter {age > 50}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
29 | 1st | 1 | Bonnell, Miss Elizabeth | 58.0 | Southampton | Birkdale, England Cleveland, Ohio | C-103 | 8 | female | |
38 | 1st | 1 | Brown, Mrs John Murray (Caroline Lane Lamson) | 59.0 | Southampton | Belmont, MA | C-101 | D | female | |
39 | 1st | 1 | Bucknell, Mrs William Robert (Emma Eliza Ward) | 60.0 | Cherbourg | Philadelphia, PA | 8 | female | ||
42 | 1st | 1 | Candee, Mrs Edward (Helen Churchill Hungerford) | 53.0 | Cherbourg | Washington, DC | 6 | female | ||
43 | 1st | 1 | Cardeza, Mrs James Warburton Martinez (Charlott... | 58.0 | Cherbourg | Germantown, Philadelphia, PA | B-51/3/5 | 17755 L512 6s | 3 | female |
68 | 1st | 1 | Compton, Mrs Alexander Taylor (Mary Eliza Inger... | 64.0 | Cherbourg | Lakewood, NJ | 14 | female | ||
71 | 1st | 1 | Cornell, Mrs Robert Clifford (Malvina Helen Lam... | 55.0 | Southampton | New York, NY | C-101 | 2 | female | |
73 | 1st | 0 | Crosby, Captain Edward Gifford | 70.0 | Southampton | Milwaukee, WI | (269) | male | ||
74 | 1st | 1 | Crosby, Mrs Edward Gifford (Catherine Elizabeth... | 69.0 | Southampton | Milwaukee, WI | 5 | female | ||
95 | 1st | 1 | Eustis, Miss Elizabeth Mussey | 53.0 | Cherbourg | Brookline, MA | 4 | female | ||
104 | 1st | 0 | Fortune, Mr Mark | 64.0 | Southampton | Winnipeg, MB | male | |||
105 | 1st | 1 | Fortune, Mrs Mark (Mary McDougald) | 60.0 | Southampton | Winnipeg, MB | 10 | female | ||
111 | 1st | 1 | Frolicher-Stehli, Mr Maxmillian | 60.0 | Cherbourg | Zurich, Switzerland | 5 | male | ||
120 | 1st | 0 | Goldschmidt, Mr George B. | 71.0 | Cherbourg | New York, NY | male | |||
121 | 1st | 1 | Gracie, Colonel Archibald IV | 54.0 | Southampton | Washington, DC | C-51 | 113780 L28 10s | B | male |
124 | 1st | 1 | Graham, Mrs William Thompson (Edith Junkins) | 58.0 | Southampton | Greenwich, CT | C-91 | 17582 L153 9s 3d | 3 | female |
135 | 1st | 0 | Hays, Mr Charles Melville | 55.0 | Southampton | Montreal, PQ | (307) | male |
... only showing top 20 rows
// find the oldest survived woman
withAges.filter {survived == 1 && sex == "female"}.maxBy{age}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
74 | 1st | 1 | Crosby, Mrs Edward Gifford (Catherine Elizabeth... | 69.0 | Southampton | Milwaukee, WI | 5 | female |
// sort by single column
withAges.sortedByDesc {age}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
506 | 2nd | 0 | Mitchell, Mr Henry Michael | 71.0 | Southampton | Guernsey / Montclair, NJ and/or Toledo, Ohio | male | |||
120 | 1st | 0 | Goldschmidt, Mr George B. | 71.0 | Cherbourg | New York, NY | male | |||
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
73 | 1st | 0 | Crosby, Captain Edward Gifford | 70.0 | Southampton | Milwaukee, WI | (269) | male | ||
74 | 1st | 1 | Crosby, Mrs Edward Gifford (Catherine Elizabeth... | 69.0 | Southampton | Milwaukee, WI | 5 | female | ||
253 | 1st | 0 | Straus, Mr Isidor | 67.0 | Southampton | New York, NY | 17483 L221 15s 7d | (96) | male | |
773 | 3rd | 0 | Dewan, Mr Frank | 65.0 | Queenstown | male | ||||
180 | 1st | 0 | Millet, Mr Francis Davis | 65.0 | Southampton | East Bridgewater, MA | (249) | male | ||
510 | 2nd | 0 | Myles, Mr Thomas Francis | 64.0 | Queenstown | Cambridge, MA | male | |||
271 | 1st | 0 | Warren, Mr Frank Manley | 64.0 | Cherbourg | Portland, OR | male | |||
194 | 1st | 0 | Ostby, Mr Engelhart Cornelius | 64.0 | Cherbourg | Providence, RI | (234) | male | ||
192 | 1st | 0 | Nicholson, Mr Arthur Ernest | 64.0 | Southampton | Isle of Wight, England | (263) | male | ||
104 | 1st | 0 | Fortune, Mr Mark | 64.0 | Southampton | Winnipeg, MB | male | |||
68 | 1st | 1 | Compton, Mrs Alexander Taylor (Mary Eliza Inger... | 64.0 | Cherbourg | Lakewood, NJ | 14 | female | ||
254 | 1st | 0 | Straus, Mrs Isidor (Ida Blun) | 63.0 | Southampton | New York, NY | 17483 L221 15s 7d | female | ||
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
252 | 1st | 1 | Stone, Mrs George Nelson (Martha E.) | 62.0 | Cincinatti, OH | 6 | female | |||
247 | 1st | 0 | Stead, Mr William Thomas | 62.0 | Southampton | Wimbledon Park, London / Hayling Island, Hants | C-89 | male | ||
269 | 1st | 0 | Van Derhoef, Mr Wyckoff | 61.0 | Southampton | Brooklyn, NY | (245) | male | ||
255 | 1st | 0 | Sutton, Mr Frederick | 61.0 | Southampton | Haddenfield, NJ | (46) | male |
... only showing top 20 rows
// sort by several columns
withAges.sortedBy {columns(age, name)}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
764 | 3rd | 1 | Dean, Miss Elizabeth Gladys (Millvena) | 0.1667 | Southampton | Devon, England Wichita, KS | 12 | female | ||
752 | 3rd | 0 | Danbom, Master Gilbert Sigvard Emanuel | 0.3333 | Southampton | Stanton, IA | male | |||
617 | 3rd | 1 | Aks, Master Philip | 0.8333 | Southampton | London, England Norfolk, VA | 392091 | 11 | male | |
359 | 2nd | 1 | Caldwell, Master Alden Gates | 0.8333 | Southampton | Bangkok, Thailand / Roseville, IL | 13 | male | ||
545 | 2nd | 1 | Richards, Master George Sidney | 0.8333 | Southampton | Cornwall / Akron, OH | 4 | male | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
340 | 2nd | 1 | Becker, Master Richard F. | 1.0 | Southampton | Guntur, India / Benton Harbour, MI | 230136 L39 | 11 | male | |
763 | 3rd | 1 | Dean, Master Bertram Vere | 1.0 | Southampton | Devon, England Wichita, KS | 12 | male | ||
426 | 2nd | 1 | Hamalainen, Master Viljo | 1.0 | Southampton | Detroit, MI | male | |||
479 | 2nd | 1 | LaRoche, Miss Louise | 1.0 | Cherbourg | Paris / Haiti | female | |||
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
628 | 3rd | 0 | Andersson, Miss Ellis Anna Maria | 2.0 | Southampton | Sweden Winnipeg, MN | female | |||
492 | 2nd | 1 | Mallet, Master Andre | 2.0 | Cherbourg | Paris / Montreal, PQ | male | |||
513 | 2nd | 1 | Navratil, Master Edmond Roger | 2.0 | Southampton | Nice, France | 230080 L26 | D | male | |
538 | 2nd | 1 | Quick, Miss Phyllis May | 2.0 | Southampton | Plymouth, Devon / Detroit, MI | 11 | female | ||
586 | 2nd | 1 | Wells, Master Ralph Lester | 2.0 | Southampton | Cornwall / Akron, OH | male | |||
645 | 3rd | 1 | Aspland, Master Edvin Rojj Felix | 3.0 | Southampton | Sweden Worcester, MA | 4 | male | ||
658 | 3rd | 1 | Baclini, Miss Eugenie | 3.0 | Cherbourg | Syria New York, NY | female | |||
738 | 3rd | 1 | Coutts, Master Neville | 3.0 | Southampton | England Brooklyn, NY | 2 | male | ||
480 | 2nd | 1 | LaRoche, Miss Simonne | 3.0 | Cherbourg | Paris / Haiti | female |
... only showing top 20 rows
// another way
withAges.sortedBy(withAges.age, withAges.name)
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
764 | 3rd | 1 | Dean, Miss Elizabeth Gladys (Millvena) | 0.1667 | Southampton | Devon, England Wichita, KS | 12 | female | ||
752 | 3rd | 0 | Danbom, Master Gilbert Sigvard Emanuel | 0.3333 | Southampton | Stanton, IA | male | |||
617 | 3rd | 1 | Aks, Master Philip | 0.8333 | Southampton | London, England Norfolk, VA | 392091 | 11 | male | |
359 | 2nd | 1 | Caldwell, Master Alden Gates | 0.8333 | Southampton | Bangkok, Thailand / Roseville, IL | 13 | male | ||
545 | 2nd | 1 | Richards, Master George Sidney | 0.8333 | Southampton | Cornwall / Akron, OH | 4 | male | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
340 | 2nd | 1 | Becker, Master Richard F. | 1.0 | Southampton | Guntur, India / Benton Harbour, MI | 230136 L39 | 11 | male | |
763 | 3rd | 1 | Dean, Master Bertram Vere | 1.0 | Southampton | Devon, England Wichita, KS | 12 | male | ||
426 | 2nd | 1 | Hamalainen, Master Viljo | 1.0 | Southampton | Detroit, MI | male | |||
479 | 2nd | 1 | LaRoche, Miss Louise | 1.0 | Cherbourg | Paris / Haiti | female | |||
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
628 | 3rd | 0 | Andersson, Miss Ellis Anna Maria | 2.0 | Southampton | Sweden Winnipeg, MN | female | |||
492 | 2nd | 1 | Mallet, Master Andre | 2.0 | Cherbourg | Paris / Montreal, PQ | male | |||
513 | 2nd | 1 | Navratil, Master Edmond Roger | 2.0 | Southampton | Nice, France | 230080 L26 | D | male | |
538 | 2nd | 1 | Quick, Miss Phyllis May | 2.0 | Southampton | Plymouth, Devon / Detroit, MI | 11 | female | ||
586 | 2nd | 1 | Wells, Master Ralph Lester | 2.0 | Southampton | Cornwall / Akron, OH | male | |||
645 | 3rd | 1 | Aspland, Master Edvin Rojj Felix | 3.0 | Southampton | Sweden Worcester, MA | 4 | male | ||
658 | 3rd | 1 | Baclini, Miss Eugenie | 3.0 | Cherbourg | Syria New York, NY | female | |||
738 | 3rd | 1 | Coutts, Master Neville | 3.0 | Southampton | England Brooklyn, NY | 2 | male | ||
480 | 2nd | 1 | LaRoche, Miss Simonne | 3.0 | Cherbourg | Paris / Haiti | female |
... only showing top 20 rows
// add new column and store result in a new field
val withYear = withAges.add("year") {1912 - age}
withYear
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex | year |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female | 1883.0 |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1910.0 | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | 1882.0 | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1887.0 | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | 1911.0833 | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | 1865.0 | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female | 1849.0 |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | 1873.0 | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | 1854.0 | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | 1841.0 | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | 1865.0 | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | 1893.0 | |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | 1862.0 | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | 1888.0 | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | 1876.0 | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | 1875.0 | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | 1865.0 | |
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | 1886.0 | |
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | 1887.0 | ||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male | 1887.0 |
... only showing top 20 rows
// check new column
withYear.year
year [Dbl][633]: 1883, 1910, 1882, 1887, 1911.083, 1865, 1849, 1873, 1854, 1841, 1865, 1893, 1862, 1...
// add several columns
withAges.add {
"year" {1912-age}
"died" {survived == 0}
}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex | year | died |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female | 1883.0 | false |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1910.0 | true | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | 1882.0 | true | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1887.0 | true | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | 1911.0833 | false | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | 1865.0 | false | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female | 1849.0 | false |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | 1873.0 | true | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | 1854.0 | false | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | 1841.0 | true | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | 1865.0 | true | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | 1893.0 | false | |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | 1862.0 | false | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | 1888.0 | true | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | 1876.0 | true | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | 1875.0 | false | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | 1865.0 | false | |
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | 1886.0 | false | |
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | 1887.0 | true | ||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male | 1887.0 | false |
... only showing top 20 rows
// plus is overloaded for adding columns
withAges + {
"year" {1912-age}
"died" {survived == 0}
}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex | year | died |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female | 1883.0 | false |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1910.0 | true | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | 1882.0 | true | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1887.0 | true | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | 1911.0833 | false | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | 1865.0 | false | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female | 1849.0 | false |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | 1873.0 | true | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | 1854.0 | false | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | 1841.0 | true | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | 1865.0 | true | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | 1893.0 | false | |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | 1862.0 | false | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | 1888.0 | true | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | 1876.0 | true | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | 1875.0 | false | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | 1865.0 | false | |
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | 1886.0 | false | |
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | 1887.0 | true | ||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male | 1887.0 | false |
... only showing top 20 rows
// another way to build new column via column arithmetics
val birthYear = withAges.age * (-1) + 1912
// new column can be added to dataframe with '+' operator
withAges + birthYear.rename("year")
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex | year |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female | 1883.0 |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1910.0 | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | 1882.0 | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 1887.0 | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | 1911.0833 | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | 1865.0 | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female | 1849.0 |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | 1873.0 | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | 1854.0 | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | 1841.0 | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | 1865.0 | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | 1893.0 | |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | 1862.0 | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | 1888.0 | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | 1876.0 | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | 1875.0 | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | 1865.0 | |
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | 1886.0 | |
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | 1887.0 | ||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male | 1887.0 |
... only showing top 20 rows
// Iterable of columns can also be added with '+'
withAges + withAges.columns.map {it.rename(it.name + " duplicate")}
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex | row duplicate | pclass duplicate | survived duplicate | name duplicate | age duplicate | embarked duplicate | home duplicate | room duplicate | ticket duplicate | boat duplicate | sex duplicate |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female | 1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | 3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | ||
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | 4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | 5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | ||
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | 6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | ||
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female | 7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | 8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | ||||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | 9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | ||
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | 10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | 11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | ||
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | 12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | ||
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | 16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | ||
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | 17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | ||||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | 18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | ||||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | 19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | ||
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | 20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | ||
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | 21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | ||
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | 22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | ||||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male | 23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male |
... only showing top 20 rows
// remove single column
df.remove{ticket}
row | pclass | survived | name | age | embarked | home | room | boat | sex |
---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 2 | female |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | |
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | |
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 10 | female |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | |
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | |
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | (124) | male | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 4 | female | |
13 | 1st | 1 | Aubert, Mrs Leontine Pauline | null | Cherbourg | Paris, France | B-35 | 9 | female |
14 | 1st | 1 | Barkworth, Mr Algernon H. | null | Southampton | Hessle, Yorks | A-23 | B | male |
15 | 1st | 0 | Baumann, Mr John D. | null | Southampton | New York, NY | male | ||
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | |
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | |
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female |
... only showing top 20 rows
// remove several columns
df.remove {columns(row, pclass, ticket, room, survived)}
name | age | embarked | home | boat | sex |
---|---|---|---|---|---|
Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | 2 | female |
Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | female | |
Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | (135) | male |
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | female | |
Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | 11 | male |
Anderson, Mr Harry | 47.0 | Southampton | New York, NY | 3 | male |
Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | 10 | female |
Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | male | |
Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | 2 | female |
Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male |
Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | (124) | male |
Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 4 | female |
Aubert, Mrs Leontine Pauline | null | Cherbourg | Paris, France | 9 | female |
Barkworth, Mr Algernon H. | null | Southampton | Hessle, Yorks | B | male |
Baumann, Mr John D. | null | Southampton | New York, NY | male | |
Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | 6 | female |
Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | male | |
Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | male | |
Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | 5 | male |
Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | 5 | female |
... only showing top 20 rows
// remove several columns by column instances
df.remove(df.row, df.pclass)
survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|
1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | |
0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | |
1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | ||
1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | |
1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
1 | Aubert, Mrs Leontine Pauline | null | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
1 | Barkworth, Mr Algernon H. | null | Southampton | Hessle, Yorks | A-23 | B | male | |
0 | Baumann, Mr John D. | null | Southampton | New York, NY | male | |||
1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | ||
0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | ||
1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | |
1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female |
... only showing top 20 rows
// '-' operator can also be used for removing columns
df - {row} - {pclass} - {room}
survived | name | age | embarked | home | ticket | boat | sex |
---|---|---|---|---|---|---|---|
1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | 24160 L221 | 2 | female |
0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | female | ||
0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | (135) | male | |
0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | female | ||
1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | 11 | male | |
1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | 3 | male | |
1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | 13502 L77 | 10 | female |
0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | male | ||
1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | 2 | female | |
0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | |
0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male |
1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female |
1 | Aubert, Mrs Leontine Pauline | null | Cherbourg | Paris, France | 17477 L69 6s | 9 | female |
1 | Barkworth, Mr Algernon H. | null | Southampton | Hessle, Yorks | B | male | |
0 | Baumann, Mr John D. | null | Southampton | New York, NY | male | ||
1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | 6 | female | |
0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | male | ||
0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | male | ||
1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | 5 | male | |
1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | 5 | female |
... only showing top 20 rows
// group by single column
df.groupBy{ embarked }.count()
embarked | n |
---|---|
Southampton | 573 |
Cherbourg | 203 |
492 | |
Queenstown | 45 |
// group by several columns
df.groupBy{ columns(sex, survived) }.count()
sex | survived | n |
---|---|---|
female | 1 | 307 |
female | 0 | 156 |
male | 0 | 708 |
male | 1 | 142 |
// another way
df.groupBy(df.sex, df.survived).count()
sex | survived | n |
---|---|---|
female | 1 | 307 |
female | 0 | 156 |
male | 0 | 708 |
male | 1 | 142 |
// Various summarization operations on grouped data frame
withAges.groupBy{ embarked }.summarize {
"total count" { size } // lamba expressions are computed for every group. Type of receiver: TypedDataFrame<*>
"survival rate" { count { survived == 1 }.toDouble() / size * 100 }
"average age" { age.mean() } // column operations are also supported
"median age" { age.median() }
val youngest = find { minBy {age}!! } // 'find' builds data frame, collecting one row for every group
"youngest" (youngest.name) // columns of collected data frame are passed in round parenthesis '()'
"youngest age" (youngest.age)
val oldest = find { maxBy {age}!! }
"oldest" (oldest.name)
"oldest age" (oldest.age)
}
embarked | total count | survival rate | average age | median age | youngest | youngest age | oldest | oldest age |
---|---|---|---|---|---|---|---|---|
Southampton | 463 | 39.740820734341256 | 29.857271274298057 | 19.0 | Dean, Miss Elizabeth Gladys (Millvena) | 0.1667 | Mitchell, Mr Henry Michael | 71.0 |
Cherbourg | 133 | 60.902255639097746 | 35.6015037593985 | 22.0 | LaRoche, Miss Louise | 1.0 | Artagaveytia, Mr Ramon | 71.0 |
Queenstown | 31 | 38.70967741935484 | 29.032258064516128 | 37.0 | Carr, Miss Helen | 16.0 | Dewan, Mr Frank | 65.0 |
6 | 66.66666666666666 | 47.833333333333336 | 47.5 | Ovies y Rodriguez, Mr Servando | 28.0 | Stone, Mrs George Nelson (Martha E.) | 62.0 |
df.size
1313
withAges.count {age > 50 }
68
withAges.sortedBy{age}.take(5)
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
764 | 3rd | 1 | Dean, Miss Elizabeth Gladys (Millvena) | 0.1667 | Southampton | Devon, England Wichita, KS | 12 | female | ||
752 | 3rd | 0 | Danbom, Master Gilbert Sigvard Emanuel | 0.3333 | Southampton | Stanton, IA | male | |||
359 | 2nd | 1 | Caldwell, Master Alden Gates | 0.8333 | Southampton | Bangkok, Thailand / Roseville, IL | 13 | male | ||
545 | 2nd | 1 | Richards, Master George Sidney | 0.8333 | Southampton | Cornwall / Akron, OH | 4 | male | ||
617 | 3rd | 1 | Aks, Master Philip | 0.8333 | Southampton | London, England Norfolk, VA | 392091 | 11 | male |
withAges.sortedBy{age}.takeLast(5)
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
74 | 1st | 1 | Crosby, Mrs Edward Gifford (Catherine Elizabeth... | 69.0 | Southampton | Milwaukee, WI | 5 | female | ||
73 | 1st | 0 | Crosby, Captain Edward Gifford | 70.0 | Southampton | Milwaukee, WI | (269) | male | ||
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
120 | 1st | 0 | Goldschmidt, Mr George B. | 71.0 | Cherbourg | New York, NY | male | |||
506 | 2nd | 0 | Mitchell, Mr Henry Michael | 71.0 | Southampton | Guernsey / Montclair, NJ and/or Toledo, Ohio | male |
// 'rows' field is Iterable<TypedDataFrameRow<*>> so it can be used in any stdlib extensions for Iterable
df.rows.map {it.name}.take(5)
[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]
// Sample List
data class Item(val first: Int, val second: Double)
val itemsList = listOf(Item(1,2.0), Item(2, 3.0), Item(3, 4.0))
// List -> DataFrame by reflection
itemsList.toDataFrame()
first | second |
---|---|
1 | 2.0 |
2 | 3.0 |
3 | 4.0 |
// List -> DataFrame by mappings
itemsList.toDataFrame {
"a" {first}
"b" {second}
"c" {first*second}
}
a | b | c |
---|---|---|
1 | 2.0 | 2.0 |
2 | 3.0 | 6.0 |
3 | 4.0 | 12.0 |
// Convert data frame to a list of data class items
val passengers = df.toList("Passenger")
// Check type of the element
passengers[0].javaClass
class Line_139_jupyter$Passenger
// Do any list operations
passengers.maxBy {it.age ?: .0}
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)
// create marker interface to write column-specific extensions for data frame
@DataFrameType
interface SimplePerson {
val name: String
val age: Double
}
// create extension for any data frame with fields 'name' and 'age'
fun TypedDataFrame<SimplePerson>.getOlderThan(minAge: Double) = filter {age > minAge}
// extension works even for objects that were created before marker interface declaration
withAges.getOlderThan(50.0)
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|---|---|---|
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | ||
29 | 1st | 1 | Bonnell, Miss Elizabeth | 58.0 | Southampton | Birkdale, England Cleveland, Ohio | C-103 | 8 | female | |
38 | 1st | 1 | Brown, Mrs John Murray (Caroline Lane Lamson) | 59.0 | Southampton | Belmont, MA | C-101 | D | female | |
39 | 1st | 1 | Bucknell, Mrs William Robert (Emma Eliza Ward) | 60.0 | Cherbourg | Philadelphia, PA | 8 | female | ||
42 | 1st | 1 | Candee, Mrs Edward (Helen Churchill Hungerford) | 53.0 | Cherbourg | Washington, DC | 6 | female | ||
43 | 1st | 1 | Cardeza, Mrs James Warburton Martinez (Charlott... | 58.0 | Cherbourg | Germantown, Philadelphia, PA | B-51/3/5 | 17755 L512 6s | 3 | female |
68 | 1st | 1 | Compton, Mrs Alexander Taylor (Mary Eliza Inger... | 64.0 | Cherbourg | Lakewood, NJ | 14 | female | ||
71 | 1st | 1 | Cornell, Mrs Robert Clifford (Malvina Helen Lam... | 55.0 | Southampton | New York, NY | C-101 | 2 | female | |
73 | 1st | 0 | Crosby, Captain Edward Gifford | 70.0 | Southampton | Milwaukee, WI | (269) | male | ||
74 | 1st | 1 | Crosby, Mrs Edward Gifford (Catherine Elizabeth... | 69.0 | Southampton | Milwaukee, WI | 5 | female | ||
95 | 1st | 1 | Eustis, Miss Elizabeth Mussey | 53.0 | Cherbourg | Brookline, MA | 4 | female | ||
104 | 1st | 0 | Fortune, Mr Mark | 64.0 | Southampton | Winnipeg, MB | male | |||
105 | 1st | 1 | Fortune, Mrs Mark (Mary McDougald) | 60.0 | Southampton | Winnipeg, MB | 10 | female | ||
111 | 1st | 1 | Frolicher-Stehli, Mr Maxmillian | 60.0 | Cherbourg | Zurich, Switzerland | 5 | male | ||
120 | 1st | 0 | Goldschmidt, Mr George B. | 71.0 | Cherbourg | New York, NY | male | |||
121 | 1st | 1 | Gracie, Colonel Archibald IV | 54.0 | Southampton | Washington, DC | C-51 | 113780 L28 10s | B | male |
124 | 1st | 1 | Graham, Mrs William Thompson (Edith Junkins) | 58.0 | Southampton | Greenwich, CT | C-91 | 17582 L153 9s 3d | 3 | female |
135 | 1st | 0 | Hays, Mr Charles Melville | 55.0 | Southampton | Montreal, PQ | (307) | male |
... only showing top 20 rows
// code for marker interface can be auto-generated
// 'getScheme' method returns generated code without execution
withAges.select{columns(name,age,home,sex)}.generateInterface("Person")
@DataFrameType(isOpen = true) interface Person{ val name: String val age: Double val home: String val sex: String }
// 'extractScheme' method generates and executes code
withAges.select{columns(name,age,home,sex)}.extractInterface("Person")
// Now interface 'Person' is available, so we can write an extension method,
// that will work for any data frame with these four columns
fun TypedDataFrame<Person>.addSummary() = add("summary"){"$sex $name $age y.o. from $home"}
// for example, it works for 'withAges' data frame
withAges.addSummary()
row | pclass | survived | name | age | embarked | home | room | ticket | boat | sex | summary |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female | female Allen, Miss Elisabeth Walton 29.0 y.o. f... |
2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | female Allison, Miss Helen Loraine 2.0 y.o. fro... | ||
3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | male Allison, Mr Hudson Joshua Creighton 30.0 y... | |
4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0 | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | female Allison, Mrs Hudson J.C. (Bessie Waldo D... | ||
5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | male Allison, Master Hudson Trevor 0.9167 y.o. ... | |
6 | 1st | 1 | Anderson, Mr Harry | 47.0 | Southampton | New York, NY | E-12 | 3 | male | male Anderson, Mr Harry 47.0 y.o. from New York... | |
7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female | female Andrews, Miss Kornelia Theodosia 63.0 y.... |
8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0 | Southampton | Belfast, NI | A-36 | male | male Andrews, Mr Thomas, jr 39.0 y.o. from Belf... | ||
9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0 | Southampton | Bayside, Queens, NY | C-101 | 2 | female | female Appleton, Mrs Edward Dale (Charlotte Lam... | |
10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0 | Cherbourg | Montevideo, Uruguay | (22) | male | male Artagaveytia, Mr Ramon 71.0 y.o. from Mont... | ||
11 | 1st | 0 | Astor, Colonel John Jacob | 47.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | male Astor, Colonel John Jacob 47.0 y.o. from N... | |
12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0 | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | female Astor, Mrs John Jacob (Madeleine Talmadg... | |
16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0 | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | female Baxter, Mrs James (Helene DeLaudeniere C... | |
17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0 | Cherbourg | Montreal, PQ | B-58/60 | male | male Baxter, Mr Quigg Edmond 24.0 y.o. from Mon... | ||
18 | 1st | 0 | Beattie, Mr Thomson | 36.0 | Cherbourg | Winnipeg, MN | C-6 | male | male Beattie, Mr Thomson 36.0 y.o. from Winnipe... | ||
19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0 | Southampton | New York, NY | D-35 | 5 | male | male Beckwith, Mr Richard Leonard 37.0 y.o. fro... | |
20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0 | Southampton | New York, NY | D-35 | 5 | female | female Beckwith, Mrs Richard Leonard (Sallie Mo... | |
21 | 1st | 1 | Behr, Mr Karl Howell | 26.0 | Cherbourg | New York, NY | C-148 | 5 | male | male Behr, Mr Karl Howell 26.0 y.o. from New Yo... | |
22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0 | Cherbourg | San Francisco, CA | (148) | male | male Birnbaum, Mr Jakob 25.0 y.o. from San Fran... | ||
23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0 | Cherbourg | Dowagiac, MI | B-49 | 7 | male | male Bishop, Mr Dickinson H. 25.0 y.o. from Dow... |
... only showing top 20 rows
// data frame can also be converted to a list of objects implementing 'Person' interface that was generated above
val persons = withAges.toList<Person>()
// check element type
persons[0].javaClass
class Line_176_jupyter$PersonImpl
persons
[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 Henry, 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)]
// When data frame variable is mutable, a strongly typed wrapper for it
// is generated only once after the first execution of a cell where it is declared
var nameAndSex = df.select(df.name, df.sex)
nameAndSex
name | sex |
---|---|
Allen, Miss Elisabeth Walton | female |
Allison, Miss Helen Loraine | female |
Allison, Mr Hudson Joshua Creighton | male |
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | female |
Allison, Master Hudson Trevor | male |
Anderson, Mr Harry | male |
Andrews, Miss Kornelia Theodosia | female |
Andrews, Mr Thomas, jr | male |
Appleton, Mrs Edward Dale (Charlotte Lamson) | female |
Artagaveytia, Mr Ramon | male |
Astor, Colonel John Jacob | male |
Astor, Mrs John Jacob (Madeleine Talmadge Force) | female |
Aubert, Mrs Leontine Pauline | female |
Barkworth, Mr Algernon H. | male |
Baumann, Mr John D. | male |
Baxter, Mrs James (Helene DeLaudeniere Chaput) | female |
Baxter, Mr Quigg Edmond | male |
Beattie, Mr Thomson | male |
Beckwith, Mr Richard Leonard | male |
Beckwith, Mrs Richard Leonard (Sallie Monypeny) | female |
... only showing top 20 rows
// let's declare immutable variable, that contains all string columns
val strings = df.selectIf{valueClass == String::class}
strings
pclass | name | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|
1st | Allen, Miss Elisabeth Walton | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
1st | Allison, Miss Helen Loraine | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1st | Allison, Mr Hudson Joshua Creighton | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | |
1st | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1st | Allison, Master Hudson Trevor | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
1st | Anderson, Mr Harry | Southampton | New York, NY | E-12 | 3 | male | |
1st | Andrews, Miss Kornelia Theodosia | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
1st | Andrews, Mr Thomas, jr | Southampton | Belfast, NI | A-36 | male | ||
1st | Appleton, Mrs Edward Dale (Charlotte Lamson) | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
1st | Artagaveytia, Mr Ramon | Cherbourg | Montevideo, Uruguay | (22) | male | ||
1st | Astor, Colonel John Jacob | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | |
1st | Astor, Mrs John Jacob (Madeleine Talmadge Force) | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
1st | Aubert, Mrs Leontine Pauline | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
1st | Barkworth, Mr Algernon H. | Southampton | Hessle, Yorks | A-23 | B | male | |
1st | Baumann, Mr John D. | Southampton | New York, NY | male | |||
1st | Baxter, Mrs James (Helene DeLaudeniere Chaput) | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
1st | Baxter, Mr Quigg Edmond | Cherbourg | Montreal, PQ | B-58/60 | male | ||
1st | Beattie, Mr Thomson | Cherbourg | Winnipeg, MN | C-6 | male | ||
1st | Beckwith, Mr Richard Leonard | Southampton | New York, NY | D-35 | 5 | male | |
1st | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | Southampton | New York, NY | D-35 | 5 | female |
... only showing top 20 rows
// 'nameAndSex' is assignable from 'strings',
// because 'strings' has all the columns that are required by type of 'nameAndSex'
nameAndSex = strings
// note, that the actual value of 'nameAndSex' is still a data frame of all string columns
nameAndSex
pclass | name | embarked | home | room | ticket | boat | sex |
---|---|---|---|---|---|---|---|
1st | Allen, Miss Elisabeth Walton | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
1st | Allison, Miss Helen Loraine | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1st | Allison, Mr Hudson Joshua Creighton | Southampton | Montreal, PQ / Chesterville, ON | C26 | (135) | male | |
1st | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | Southampton | Montreal, PQ / Chesterville, ON | C26 | female | ||
1st | Allison, Master Hudson Trevor | Southampton | Montreal, PQ / Chesterville, ON | C22 | 11 | male | |
1st | Anderson, Mr Harry | Southampton | New York, NY | E-12 | 3 | male | |
1st | Andrews, Miss Kornelia Theodosia | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
1st | Andrews, Mr Thomas, jr | Southampton | Belfast, NI | A-36 | male | ||
1st | Appleton, Mrs Edward Dale (Charlotte Lamson) | Southampton | Bayside, Queens, NY | C-101 | 2 | female | |
1st | Artagaveytia, Mr Ramon | Cherbourg | Montevideo, Uruguay | (22) | male | ||
1st | Astor, Colonel John Jacob | Cherbourg | New York, NY | 17754 L224 10s 6d | (124) | male | |
1st | Astor, Mrs John Jacob (Madeleine Talmadge Force) | Cherbourg | New York, NY | 17754 L224 10s 6d | 4 | female | |
1st | Aubert, Mrs Leontine Pauline | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
1st | Barkworth, Mr Algernon H. | Southampton | Hessle, Yorks | A-23 | B | male | |
1st | Baumann, Mr John D. | Southampton | New York, NY | male | |||
1st | Baxter, Mrs James (Helene DeLaudeniere Chaput) | Cherbourg | Montreal, PQ | B-58/60 | 6 | female | |
1st | Baxter, Mr Quigg Edmond | Cherbourg | Montreal, PQ | B-58/60 | male | ||
1st | Beattie, Mr Thomson | Cherbourg | Winnipeg, MN | C-6 | male | ||
1st | Beckwith, Mr Richard Leonard | Southampton | New York, NY | D-35 | 5 | male | |
1st | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | Southampton | New York, NY | D-35 | 5 | female |
... only showing top 20 rows
// but typed access to the fields works only for 'name' and 'sex'
nameAndSex.sex // this is OK
sex [Str][1313]: female, female, male, female, male, male, female, male, female, male, male, female,...
nameAndSex.home // this fails with compilation error
Type mismatch: inferred type is TypedDataFrame<Line_181_jupyter.DataFrameType7> but TypedDataFrame<Line_194_jupyter.DataFrameType11> was expected
nameAndSex["home"] // the requested column is still available by column name string
home [Str][1313]: St Louis, MO, Montreal, PQ / Chesterville, ON, Montreal, PQ / Chesterville, ON, Mo...
// now let's create a variable with two other columns
val nameAndHome = df.select(df.name, df.home)
nameAndHome
name | home |
---|---|
Allen, Miss Elisabeth Walton | St Louis, MO |
Allison, Miss Helen Loraine | Montreal, PQ / Chesterville, ON |
Allison, Mr Hudson Joshua Creighton | Montreal, PQ / Chesterville, ON |
Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | Montreal, PQ / Chesterville, ON |
Allison, Master Hudson Trevor | Montreal, PQ / Chesterville, ON |
Anderson, Mr Harry | New York, NY |
Andrews, Miss Kornelia Theodosia | Hudson, NY |
Andrews, Mr Thomas, jr | Belfast, NI |
Appleton, Mrs Edward Dale (Charlotte Lamson) | Bayside, Queens, NY |
Artagaveytia, Mr Ramon | Montevideo, Uruguay |
Astor, Colonel John Jacob | New York, NY |
Astor, Mrs John Jacob (Madeleine Talmadge Force) | New York, NY |
Aubert, Mrs Leontine Pauline | Paris, 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 Edmond | Montreal, PQ |
Beattie, Mr Thomson | Winnipeg, MN |
Beckwith, Mr Richard Leonard | New York, NY |
Beckwith, Mrs Richard Leonard (Sallie Monypeny) | New York, NY |
... only showing top 20 rows
nameAndSex = nameAndHome // this assignment doesn't work because of columns mismatch
Type mismatch: inferred type is TypedDataFrame<Line_217_jupyter.DataFrameType12> but TypedDataFrame<Line_181_jupyter.DataFrameType7> was expected
// unfortunately, there is a way to get a runtime error here,
// because typed wrappers are generated only after execution of a cell
// so the following assigment will pass fine, because return type of 'select' is the same as in 'df' variable,
// although the set of columns was reduced
nameAndSex = df.select(df.name, df.home)
// if we try to access the column, we get runtime error
nameAndSex.sex
java.util.NoSuchElementException: Could not find column 'sex' in dataframe krangl.SimpleDataFrame.get(SimpleDataFrame.kt:129) krangl.typed.TypedDataFrame$DefaultImpls.get(TypedDataFrame.kt:43) krangl.typed.TypedDataFrameImpl.get(TypedDataFrame.kt:73) Line_184_jupyter.getSex(Unknown Source) Line_227_jupyter.<init>(Unknown Source) java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.evalWithConfigAndOtherScriptsResults(BasicJvmScriptEvaluator.kt:95) kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke$suspendImpl(BasicJvmScriptEvaluator.kt:40) kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke(BasicJvmScriptEvaluator.kt) kotlin.script.experimental.jvmhost.repl.JvmReplEvaluator$eval$$inlined$write$lambda$2.invokeSuspend(legacyReplEvaluation.kt:57) kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:80) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36) org.jetbrains.kotlin.mainKts.relocatedDeps.kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) kotlin.script.experimental.jvmhost.repl.JvmReplEvaluator.eval(legacyReplEvaluation.kt:57) org.jetbrains.kotlin.cli.common.repl.ReplEvalAction$DefaultImpls.eval$default(ReplApi.kt:123) org.jetbrains.kotlin.jupyter.ReplForJupyterImpl.doEval(repl.kt:429) org.jetbrains.kotlin.jupyter.ReplForJupyterImpl.eval(repl.kt:349) org.jetbrains.kotlin.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:91) org.jetbrains.kotlin.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt) org.jetbrains.kotlin.jupyter.ProtocolKt.evalWithIO(protocol.kt:252) org.jetbrains.kotlin.jupyter.ProtocolKt.shellMessagesHandler(protocol.kt:90) org.jetbrains.kotlin.jupyter.IkotlinKt.kernelServer(ikotlin.kt:104) org.jetbrains.kotlin.jupyter.IkotlinKt.main(ikotlin.kt:59)
Support operations:
Improve typed wrappers for: