Expand Menu
-
Home / Documentation / Utilities / Read Json / Index
read_json¶
In [ ]:
read_json(path: str,
schema: str = '',
table_name: str = '',
usecols: list = [],
new_name: dict = {},
insert: bool = False,
temporary_table: bool = False,
temporary_local_table: bool = False,
ingest_local: bool = True,)
Ingests a JSON file using flex tables.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
path | str | ❌ | Absolute path where the JSON file is located. |
schema | str | ✓ | Schema where the JSON file will be ingested. |
table_name | str | ✓ | Final relation name. |
usecols | list | ✓ | List of the JSON parameters to ingest. The other ones will be ignored. If empty all the JSON parameters will be ingested. |
new_name | dict | ✓ | Dictionary of the new columns name. If the JSON file is nested, it is advised to change the final names as special characters will be included. For example, {"param": {"age": 3, "name": Badr}, "date": 1993-03-11} will create 3 columns: "param.age", "param.name" and "date". You can rename these columns using the 'new_name' parameter with the following dictionary: {"param.age": "age", "param.name": "name"} |
insert | bool | ✓ | If set to True, the data will be ingested to the input relation. The JSON parameters must be the same than the input relation otherwise they will not be ingested. |
temporary_table | bool | ✓ | If set to True, a temporary table will be created. |
temporary_local_table | bool | ✓ | If set to True, a temporary local table will be created and the parameter 'schema' is ignored. |
ingest_local | bool | ✓ | If set to True, the file will be ingested from the local machine. |
Returns¶
vDataFrame : The vDataFrame of the relation.
Example¶
In [9]:
from verticapy.utilities import *
# Ingesting the JSON file
read_json("titanic.json",
table_name = "titanic_dataset",
schema = "public")
The table "public"."titanic_dataset" has been successfully created.
123 fields.parchInt | Abc Varchar(164) | Abc fields.sexVarchar(20) | 010 fields.survivedBoolean | Abc fields.ticketVarchar(36) | Abc fields.embarkedVarchar(20) | 123 fields.sibspInt | 📅 record_timestampTimestamp | 123 fields.passengeridInt | Abc Varchar(100) | 123 fields.ageFloat | 123 fields.fareFloat | Abc fields.cabinVarchar(30) | 123 fields.pclassInt | Abc datasetidVarchar(36) | |
1 | 0 | male | 13049 | C | 0 | 2016-09-20 15:34:51.313 | 584 | 36.0 | 40.125 | A10 | 1 | titanic-passengers | |||
2 | 0 | male | 110465 | S | 0 | 2016-09-20 15:34:51.313 | 476 | [null] | 52.0 | A14 | 1 | titanic-passengers | |||
3 | 0 | female | 11755 | C | 1 | 2016-09-20 15:34:51.313 | 557 | 48.0 | 39.6 | A16 | 1 | titanic-passengers | |||
4 | 0 | male | 113056 | S | 0 | 2016-09-20 15:34:51.313 | 285 | [null] | 26.0 | A19 | 1 | titanic-passengers | |||
5 | 0 | male | PC 17485 | C | 1 | 2016-09-20 15:34:51.313 | 600 | 49.0 | 56.9292 | A20 | 1 | titanic-passengers | |||
6 | 0 | male | 27042 | S | 0 | 2016-09-20 15:34:51.313 | 631 | 80.0 | 30.0 | A23 | 1 | titanic-passengers | |||
7 | 0 | male | PC 17590 | S | 0 | 2016-09-20 15:34:51.313 | 868 | 31.0 | 50.4958 | A24 | 1 | titanic-passengers | |||
8 | 0 | male | 13213 | C | 0 | 2016-09-20 15:34:51.313 | 648 | 56.0 | 35.5 | A26 | 1 | titanic-passengers | |||
9 | 0 | male | 112277 | C | 0 | 2016-09-20 15:34:51.313 | 210 | 40.0 | 31.0 | A31 | 1 | titanic-passengers | |||
10 | 0 | male | 113767 | S | 0 | 2016-09-20 15:34:51.313 | 186 | [null] | 50.0 | A32 | 1 | titanic-passengers | |||
11 | 2 | male | 33638 | S | 0 | 2016-09-20 15:34:51.313 | 446 | 4.0 | 81.8583 | A34 | 1 | titanic-passengers | |||
12 | 0 | male | 112050 | S | 0 | 2016-09-20 15:34:51.313 | 807 | 39.0 | 0.0 | A36 | 1 | titanic-passengers | |||
13 | 0 | male | PC 17754 | C | 0 | 2016-09-20 15:34:51.313 | 97 | 71.0 | 34.6542 | A5 | 1 | titanic-passengers | |||
14 | 0 | male | 113788 | S | 0 | 2016-09-20 15:34:51.313 | 24 | 28.0 | 35.5 | A6 | 1 | titanic-passengers | |||
15 | 0 | male | 17764 | C | 0 | 2016-09-20 15:34:51.313 | 175 | 56.0 | 30.6958 | A7 | 1 | titanic-passengers | |||
16 | 0 | male | PC 17755 | C | 0 | 2016-09-20 15:34:51.313 | 738 | 35.0 | 512.3292 | B101 | 1 | titanic-passengers | |||
17 | 0 | male | 112058 | S | 0 | 2016-09-20 15:34:51.313 | 816 | [null] | 0.0 | B102 | 1 | titanic-passengers | |||
18 | 1 | female | 111361 | C | 0 | 2016-09-20 15:34:51.313 | 330 | 16.0 | 57.9792 | B18 | 1 | titanic-passengers | |||
19 | 1 | female | 111361 | C | 0 | 2016-09-20 15:34:51.313 | 524 | 44.0 | 57.9792 | B18 | 1 | titanic-passengers | |||
20 | 0 | male | 111240 | S | 0 | 2016-09-20 15:34:51.313 | 171 | 61.0 | 33.5 | B19 | 1 | titanic-passengers | |||
21 | 0 | female | 17474 | S | 1 | 2016-09-20 15:34:51.313 | 782 | 17.0 | 57.0 | B20 | 1 | titanic-passengers | |||
22 | 0 | male | 17474 | S | 1 | 2016-09-20 15:34:51.313 | 691 | 31.0 | 57.0 | B20 | 1 | titanic-passengers | |||
23 | 2 | female | WE/P 5735 | S | 0 | 2016-09-20 15:34:51.313 | 541 | 36.0 | 71.0 | B22 | 1 | titanic-passengers | |||
24 | 1 | male | WE/P 5735 | S | 1 | 2016-09-20 15:34:51.313 | 746 | 70.0 | 71.0 | B22 | 1 | titanic-passengers | |||
25 | 0 | female | 113572 | [null] | 0 | 2016-09-20 15:34:51.313 | 62 | 38.0 | 80.0 | B28 | 1 | titanic-passengers | |||
26 | 0 | female | 113572 | [null] | 0 | 2016-09-20 15:34:51.313 | 830 | 62.0 | 80.0 | B28 | 1 | titanic-passengers | |||
27 | 1 | female | 24160 | S | 0 | 2016-09-20 15:34:51.313 | 780 | 43.0 | 211.3375 | B3 | 1 | titanic-passengers | |||
28 | 1 | male | 113509 | C | 0 | 2016-09-20 15:34:51.313 | 55 | 65.0 | 61.9792 | B30 | 1 | titanic-passengers | |||
29 | 0 | female | PC 17477 | C | 0 | 2016-09-20 15:34:51.313 | 370 | 24.0 | 69.3 | B35 | 1 | titanic-passengers | |||
30 | 0 | female | PC 17477 | C | 0 | 2016-09-20 15:34:51.313 | 642 | 24.0 | 69.3 | B35 | 1 | titanic-passengers | |||
31 | 0 | male | 11771 | C | 0 | 2016-09-20 15:34:51.313 | 488 | 58.0 | 29.7 | B37 | 1 | titanic-passengers | |||
32 | 0 | male | 113050 | S | 0 | 2016-09-20 15:34:51.313 | 537 | 45.0 | 26.55 | B38 | 1 | titanic-passengers | |||
33 | 2 | female | 13568 | C | 0 | 2016-09-20 15:34:51.313 | 540 | 22.0 | 49.5 | B39 | 1 | titanic-passengers | |||
34 | 0 | female | PC 17610 | C | 0 | 2016-09-20 15:34:51.313 | 195 | 44.0 | 27.7208 | B4 | 1 | titanic-passengers | |||
35 | 1 | male | 13567 | C | 1 | 2016-09-20 15:34:51.313 | 588 | 60.0 | 79.2 | B41 | 1 | titanic-passengers | |||
36 | 0 | female | 112053 | S | 0 | 2016-09-20 15:34:51.313 | 888 | 19.0 | 30.0 | B42 | 1 | titanic-passengers | |||
37 | 0 | female | 11967 | C | 1 | 2016-09-20 15:34:51.313 | 292 | 19.0 | 91.0792 | B49 | 1 | titanic-passengers | |||
38 | 0 | male | 11967 | C | 1 | 2016-09-20 15:34:51.313 | 485 | 25.0 | 91.0792 | B49 | 1 | titanic-passengers | |||
39 | 1 | female | 24160 | S | 0 | 2016-09-20 15:34:51.313 | 690 | 15.0 | 211.3375 | B5 | 1 | titanic-passengers | |||
40 | 0 | female | 24160 | S | 0 | 2016-09-20 15:34:51.313 | 731 | 29.0 | 211.3375 | B5 | 1 | titanic-passengers | |||
41 | 0 | male | 13214 | C | 0 | 2016-09-20 15:34:51.313 | 633 | 32.0 | 30.5 | B50 | 1 | titanic-passengers | |||
42 | 0 | male | 695 | S | 0 | 2016-09-20 15:34:51.313 | 873 | 33.0 | 5.0 | B51 B53 B55 | 1 | titanic-passengers | |||
43 | 1 | male | PC 17755 | C | 0 | 2016-09-20 15:34:51.313 | 680 | 36.0 | 512.3292 | B51 B53 B55 | 1 | titanic-passengers | |||
44 | 2 | female | PC 17608 | C | 2 | 2016-09-20 15:34:51.313 | 312 | 18.0 | 262.375 | B57 B59 B63 B66 | 1 | titanic-passengers | |||
45 | 2 | female | PC 17608 | C | 2 | 2016-09-20 15:34:51.313 | 743 | 21.0 | 262.375 | B57 B59 B63 B66 | 1 | titanic-passengers | |||
46 | 1 | male | PC 17558 | C | 0 | 2016-09-20 15:34:51.313 | 119 | 24.0 | 247.5208 | B58 B60 | 1 | titanic-passengers | |||
47 | 1 | female | PC 17558 | C | 0 | 2016-09-20 15:34:51.313 | 300 | 50.0 | 247.5208 | B58 B60 | 1 | titanic-passengers | |||
48 | 1 | female | 12749 | S | 1 | 2016-09-20 15:34:51.313 | 821 | 52.0 | 93.5 | B69 | 1 | titanic-passengers | |||
49 | 0 | male | F.C. 12750 | S | 1 | 2016-09-20 15:34:51.313 | 672 | 31.0 | 52.0 | B71 | 1 | titanic-passengers | |||
50 | 0 | female | 12749 | S | 0 | 2016-09-20 15:34:51.313 | 521 | 30.0 | 93.5 | B73 | 1 | titanic-passengers | |||
51 | 0 | female | 110152 | S | 0 | 2016-09-20 15:34:51.313 | 258 | 30.0 | 86.5 | B77 | 1 | titanic-passengers | |||
52 | 0 | female | 110152 | S | 0 | 2016-09-20 15:34:51.313 | 760 | 33.0 | 86.5 | B77 | 1 | titanic-passengers | |||
53 | 0 | female | PC 17569 | C | 1 | 2016-09-20 15:34:51.313 | 32 | [null] | 146.5208 | B78 | 1 | titanic-passengers | |||
54 | 0 | female | 110152 | S | 0 | 2016-09-20 15:34:51.313 | 505 | 16.0 | 86.5 | B79 | 1 | titanic-passengers | |||
55 | 0 | female | PC 17569 | C | 0 | 2016-09-20 15:34:51.313 | 196 | 58.0 | 146.5208 | B80 | 1 | titanic-passengers | |||
56 | 0 | male | PC 17593 | C | 0 | 2016-09-20 15:34:51.313 | 790 | 46.0 | 79.2 | B82 B84 | 1 | titanic-passengers | |||
57 | 0 | male | PC 17593 | C | 0 | 2016-09-20 15:34:51.313 | 140 | 24.0 | 79.2 | B86 | 1 | titanic-passengers | |||
58 | 0 | male | 112059 | S | 0 | 2016-09-20 15:34:51.313 | 264 | 40.0 | 0.0 | B94 | 1 | titanic-passengers | |||
59 | 2 | male | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 803 | 11.0 | 120.0 | B96 B98 | 1 | titanic-passengers | |||
60 | 2 | female | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 436 | 14.0 | 120.0 | B96 B98 | 1 | titanic-passengers | |||
61 | 2 | male | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 391 | 36.0 | 120.0 | B96 B98 | 1 | titanic-passengers | |||
62 | 2 | female | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 764 | 36.0 | 120.0 | B96 B98 | 1 | titanic-passengers | |||
63 | 0 | female | 11769 | S | 2 | 2016-09-20 15:34:51.313 | 572 | 53.0 | 51.4792 | C101 | 1 | titanic-passengers | |||
64 | 0 | female | 113783 | S | 0 | 2016-09-20 15:34:51.313 | 12 | 58.0 | 26.55 | C103 | 1 | titanic-passengers | |||
65 | 0 | male | 113786 | S | 0 | 2016-09-20 15:34:51.313 | 450 | 52.0 | 30.5 | C104 | 1 | titanic-passengers | |||
66 | 0 | male | 19988 | S | 0 | 2016-09-20 15:34:51.313 | 299 | [null] | 30.5 | C106 | 1 | titanic-passengers | |||
67 | 0 | male | 110465 | S | 0 | 2016-09-20 15:34:51.313 | 111 | 47.0 | 52.0 | C110 | 1 | titanic-passengers | |||
68 | 0 | male | 113051 | C | 0 | 2016-09-20 15:34:51.313 | 453 | 30.0 | 27.75 | C111 | 1 | titanic-passengers | |||
69 | 1 | male | PC 17596 | C | 0 | 2016-09-20 15:34:51.313 | 274 | 37.0 | 29.7 | C118 | 1 | titanic-passengers | |||
70 | 0 | female | 113803 | S | 1 | 2016-09-20 15:34:51.313 | 4 | 35.0 | 53.1 | C123 | 1 | titanic-passengers | |||
71 | 0 | male | 113803 | S | 1 | 2016-09-20 15:34:51.313 | 138 | 37.0 | 53.1 | C123 | 1 | titanic-passengers | |||
72 | 0 | male | 113043 | S | 0 | 2016-09-20 15:34:51.313 | 332 | 45.5 | 28.5 | C124 | 1 | titanic-passengers | |||
73 | 0 | male | 113028 | S | 0 | 2016-09-20 15:34:51.313 | 712 | [null] | 26.55 | C124 | 1 | titanic-passengers | |||
74 | 0 | female | PC 17582 | S | 0 | 2016-09-20 15:34:51.313 | 610 | 40.0 | 153.4625 | C125 | 1 | titanic-passengers | |||
75 | 1 | female | PC 17582 | S | 0 | 2016-09-20 15:34:51.313 | 269 | 58.0 | 153.4625 | C125 | 1 | titanic-passengers | |||
76 | 0 | male | 19996 | S | 1 | 2016-09-20 15:34:51.313 | 713 | 48.0 | 52.0 | C126 | 1 | titanic-passengers | |||
77 | 0 | female | 19996 | S | 1 | 2016-09-20 15:34:51.313 | 670 | [null] | 52.0 | C126 | 1 | titanic-passengers | |||
78 | 0 | male | 113510 | S | 0 | 2016-09-20 15:34:51.313 | 352 | [null] | 35.0 | C128 | 1 | titanic-passengers | |||
79 | 0 | male | 111369 | C | 0 | 2016-09-20 15:34:51.313 | 890 | 26.0 | 30.0 | C148 | 1 | titanic-passengers | |||
80 | 0 | female | 113776 | S | 1 | 2016-09-20 15:34:51.313 | 152 | 22.0 | 66.6 | C2 | 1 | titanic-passengers | |||
81 | 0 | male | 113776 | S | 1 | 2016-09-20 15:34:51.313 | 337 | 29.0 | 66.6 | C2 | 1 | titanic-passengers | |||
82 | 2 | male | 113781 | S | 1 | 2016-09-20 15:34:51.313 | 306 | 0.92 | 151.55 | C22 C26 | 1 | titanic-passengers | |||
83 | 2 | female | 113781 | S | 1 | 2016-09-20 15:34:51.313 | 298 | 2.0 | 151.55 | C22 C26 | 1 | titanic-passengers | |||
84 | 2 | female | 113781 | S | 1 | 2016-09-20 15:34:51.313 | 499 | 25.0 | 151.55 | C22 C26 | 1 | titanic-passengers | |||
85 | 2 | male | 19950 | S | 3 | 2016-09-20 15:34:51.313 | 28 | 19.0 | 263.0 | C23 C25 C27 | 1 | titanic-passengers | |||
86 | 2 | female | 19950 | S | 3 | 2016-09-20 15:34:51.313 | 89 | 23.0 | 263.0 | C23 C25 C27 | 1 | titanic-passengers | |||
87 | 2 | female | 19950 | S | 3 | 2016-09-20 15:34:51.313 | 342 | 24.0 | 263.0 | C23 C25 C27 | 1 | titanic-passengers | |||
88 | 4 | male | 19950 | S | 1 | 2016-09-20 15:34:51.313 | 439 | 64.0 | 263.0 | C23 C25 C27 | 1 | titanic-passengers | |||
89 | 0 | male | 113787 | S | 0 | 2016-09-20 15:34:51.313 | 493 | 55.0 | 30.5 | C30 | 1 | titanic-passengers | |||
90 | 0 | female | PC 17760 | C | 0 | 2016-09-20 15:34:51.313 | 326 | 36.0 | 135.6333 | C32 | 1 | titanic-passengers | |||
91 | 0 | female | PC 17757 | C | 0 | 2016-09-20 15:34:51.313 | 717 | 38.0 | 227.525 | C45 | 1 | titanic-passengers | |||
92 | 0 | male | 19877 | S | 1 | 2016-09-20 15:34:51.313 | 742 | 36.0 | 78.85 | C46 | 1 | titanic-passengers | |||
93 | 0 | male | 11774 | C | 0 | 2016-09-20 15:34:51.313 | 840 | [null] | 29.7 | C47 | 1 | titanic-passengers | |||
94 | 0 | female | PC 17595 | C | 0 | 2016-09-20 15:34:51.313 | 178 | 50.0 | 28.7125 | C49 | 1 | titanic-passengers | |||
95 | 1 | female | 11767 | C | 0 | 2016-09-20 15:34:51.313 | 880 | 56.0 | 83.1583 | C50 | 1 | titanic-passengers | |||
96 | 0 | male | 110564 | S | 0 | 2016-09-20 15:34:51.313 | 431 | 28.0 | 26.55 | C52 | 1 | titanic-passengers | |||
97 | 0 | male | 19947 | S | 0 | 2016-09-20 15:34:51.313 | 56 | [null] | 35.5 | C52 | 1 | titanic-passengers | |||
98 | 0 | female | 11767 | C | 0 | 2016-09-20 15:34:51.313 | 311 | 24.0 | 83.1583 | C54 | 1 | titanic-passengers | |||
99 | 0 | female | PC 17757 | C | 1 | 2016-09-20 15:34:51.313 | 701 | 18.0 | 227.525 | C62 C64 | 1 | titanic-passengers | |||
100 | 0 | female | PC 17758 | C | 1 | 2016-09-20 15:34:51.313 | 308 | 17.0 | 108.9 | C65 | 1 | titanic-passengers |
Out[9]:
Rows: 1-100 of 891 | Columns: 15
In [11]:
# Ingesting the JSON file and renaming some columns
read_json("titanic.json",
table_name = "titanic_dataset",
schema = "public",
new_name = {"fields.fare": "fare",
"fields.sex": "sex"})
The table "public"."titanic_dataset" has been successfully created.
123 fields.parchInt | Abc Varchar(164) | Abc sexVarchar(20) | 010 fields.survivedBoolean | Abc fields.ticketVarchar(36) | Abc fields.embarkedVarchar(20) | 123 fields.sibspInt | 📅 record_timestampTimestamp | 123 fields.passengeridInt | Abc Varchar(100) | 123 fields.ageFloat | Abc fields.cabinVarchar(30) | 123 fields.pclassInt | Abc datasetidVarchar(36) | 123 fareFloat | |
1 | 0 | male | 13049 | C | 0 | 2016-09-20 15:34:51.313 | 584 | 36.0 | A10 | 1 | titanic-passengers | 40.125 | |||
2 | 0 | male | 110465 | S | 0 | 2016-09-20 15:34:51.313 | 476 | [null] | A14 | 1 | titanic-passengers | 52.0 | |||
3 | 0 | female | 11755 | C | 1 | 2016-09-20 15:34:51.313 | 557 | 48.0 | A16 | 1 | titanic-passengers | 39.6 | |||
4 | 0 | male | 113056 | S | 0 | 2016-09-20 15:34:51.313 | 285 | [null] | A19 | 1 | titanic-passengers | 26.0 | |||
5 | 0 | male | PC 17485 | C | 1 | 2016-09-20 15:34:51.313 | 600 | 49.0 | A20 | 1 | titanic-passengers | 56.9292 | |||
6 | 0 | male | 27042 | S | 0 | 2016-09-20 15:34:51.313 | 631 | 80.0 | A23 | 1 | titanic-passengers | 30.0 | |||
7 | 0 | male | PC 17590 | S | 0 | 2016-09-20 15:34:51.313 | 868 | 31.0 | A24 | 1 | titanic-passengers | 50.4958 | |||
8 | 0 | male | 13213 | C | 0 | 2016-09-20 15:34:51.313 | 648 | 56.0 | A26 | 1 | titanic-passengers | 35.5 | |||
9 | 0 | male | 112277 | C | 0 | 2016-09-20 15:34:51.313 | 210 | 40.0 | A31 | 1 | titanic-passengers | 31.0 | |||
10 | 0 | male | 113767 | S | 0 | 2016-09-20 15:34:51.313 | 186 | [null] | A32 | 1 | titanic-passengers | 50.0 | |||
11 | 2 | male | 33638 | S | 0 | 2016-09-20 15:34:51.313 | 446 | 4.0 | A34 | 1 | titanic-passengers | 81.8583 | |||
12 | 0 | male | 112050 | S | 0 | 2016-09-20 15:34:51.313 | 807 | 39.0 | A36 | 1 | titanic-passengers | 0.0 | |||
13 | 0 | male | PC 17754 | C | 0 | 2016-09-20 15:34:51.313 | 97 | 71.0 | A5 | 1 | titanic-passengers | 34.6542 | |||
14 | 0 | male | 113788 | S | 0 | 2016-09-20 15:34:51.313 | 24 | 28.0 | A6 | 1 | titanic-passengers | 35.5 | |||
15 | 0 | male | 17764 | C | 0 | 2016-09-20 15:34:51.313 | 175 | 56.0 | A7 | 1 | titanic-passengers | 30.6958 | |||
16 | 0 | male | PC 17755 | C | 0 | 2016-09-20 15:34:51.313 | 738 | 35.0 | B101 | 1 | titanic-passengers | 512.3292 | |||
17 | 0 | male | 112058 | S | 0 | 2016-09-20 15:34:51.313 | 816 | [null] | B102 | 1 | titanic-passengers | 0.0 | |||
18 | 1 | female | 111361 | C | 0 | 2016-09-20 15:34:51.313 | 330 | 16.0 | B18 | 1 | titanic-passengers | 57.9792 | |||
19 | 1 | female | 111361 | C | 0 | 2016-09-20 15:34:51.313 | 524 | 44.0 | B18 | 1 | titanic-passengers | 57.9792 | |||
20 | 0 | male | 111240 | S | 0 | 2016-09-20 15:34:51.313 | 171 | 61.0 | B19 | 1 | titanic-passengers | 33.5 | |||
21 | 0 | female | 17474 | S | 1 | 2016-09-20 15:34:51.313 | 782 | 17.0 | B20 | 1 | titanic-passengers | 57.0 | |||
22 | 0 | male | 17474 | S | 1 | 2016-09-20 15:34:51.313 | 691 | 31.0 | B20 | 1 | titanic-passengers | 57.0 | |||
23 | 2 | female | WE/P 5735 | S | 0 | 2016-09-20 15:34:51.313 | 541 | 36.0 | B22 | 1 | titanic-passengers | 71.0 | |||
24 | 1 | male | WE/P 5735 | S | 1 | 2016-09-20 15:34:51.313 | 746 | 70.0 | B22 | 1 | titanic-passengers | 71.0 | |||
25 | 0 | female | 113572 | [null] | 0 | 2016-09-20 15:34:51.313 | 62 | 38.0 | B28 | 1 | titanic-passengers | 80.0 | |||
26 | 0 | female | 113572 | [null] | 0 | 2016-09-20 15:34:51.313 | 830 | 62.0 | B28 | 1 | titanic-passengers | 80.0 | |||
27 | 1 | female | 24160 | S | 0 | 2016-09-20 15:34:51.313 | 780 | 43.0 | B3 | 1 | titanic-passengers | 211.3375 | |||
28 | 1 | male | 113509 | C | 0 | 2016-09-20 15:34:51.313 | 55 | 65.0 | B30 | 1 | titanic-passengers | 61.9792 | |||
29 | 0 | female | PC 17477 | C | 0 | 2016-09-20 15:34:51.313 | 370 | 24.0 | B35 | 1 | titanic-passengers | 69.3 | |||
30 | 0 | female | PC 17477 | C | 0 | 2016-09-20 15:34:51.313 | 642 | 24.0 | B35 | 1 | titanic-passengers | 69.3 | |||
31 | 0 | male | 11771 | C | 0 | 2016-09-20 15:34:51.313 | 488 | 58.0 | B37 | 1 | titanic-passengers | 29.7 | |||
32 | 0 | male | 113050 | S | 0 | 2016-09-20 15:34:51.313 | 537 | 45.0 | B38 | 1 | titanic-passengers | 26.55 | |||
33 | 2 | female | 13568 | C | 0 | 2016-09-20 15:34:51.313 | 540 | 22.0 | B39 | 1 | titanic-passengers | 49.5 | |||
34 | 0 | female | PC 17610 | C | 0 | 2016-09-20 15:34:51.313 | 195 | 44.0 | B4 | 1 | titanic-passengers | 27.7208 | |||
35 | 1 | male | 13567 | C | 1 | 2016-09-20 15:34:51.313 | 588 | 60.0 | B41 | 1 | titanic-passengers | 79.2 | |||
36 | 0 | female | 112053 | S | 0 | 2016-09-20 15:34:51.313 | 888 | 19.0 | B42 | 1 | titanic-passengers | 30.0 | |||
37 | 0 | female | 11967 | C | 1 | 2016-09-20 15:34:51.313 | 292 | 19.0 | B49 | 1 | titanic-passengers | 91.0792 | |||
38 | 0 | male | 11967 | C | 1 | 2016-09-20 15:34:51.313 | 485 | 25.0 | B49 | 1 | titanic-passengers | 91.0792 | |||
39 | 1 | female | 24160 | S | 0 | 2016-09-20 15:34:51.313 | 690 | 15.0 | B5 | 1 | titanic-passengers | 211.3375 | |||
40 | 0 | female | 24160 | S | 0 | 2016-09-20 15:34:51.313 | 731 | 29.0 | B5 | 1 | titanic-passengers | 211.3375 | |||
41 | 0 | male | 13214 | C | 0 | 2016-09-20 15:34:51.313 | 633 | 32.0 | B50 | 1 | titanic-passengers | 30.5 | |||
42 | 0 | male | 695 | S | 0 | 2016-09-20 15:34:51.313 | 873 | 33.0 | B51 B53 B55 | 1 | titanic-passengers | 5.0 | |||
43 | 1 | male | PC 17755 | C | 0 | 2016-09-20 15:34:51.313 | 680 | 36.0 | B51 B53 B55 | 1 | titanic-passengers | 512.3292 | |||
44 | 2 | female | PC 17608 | C | 2 | 2016-09-20 15:34:51.313 | 312 | 18.0 | B57 B59 B63 B66 | 1 | titanic-passengers | 262.375 | |||
45 | 2 | female | PC 17608 | C | 2 | 2016-09-20 15:34:51.313 | 743 | 21.0 | B57 B59 B63 B66 | 1 | titanic-passengers | 262.375 | |||
46 | 1 | male | PC 17558 | C | 0 | 2016-09-20 15:34:51.313 | 119 | 24.0 | B58 B60 | 1 | titanic-passengers | 247.5208 | |||
47 | 1 | female | PC 17558 | C | 0 | 2016-09-20 15:34:51.313 | 300 | 50.0 | B58 B60 | 1 | titanic-passengers | 247.5208 | |||
48 | 1 | female | 12749 | S | 1 | 2016-09-20 15:34:51.313 | 821 | 52.0 | B69 | 1 | titanic-passengers | 93.5 | |||
49 | 0 | male | F.C. 12750 | S | 1 | 2016-09-20 15:34:51.313 | 672 | 31.0 | B71 | 1 | titanic-passengers | 52.0 | |||
50 | 0 | female | 12749 | S | 0 | 2016-09-20 15:34:51.313 | 521 | 30.0 | B73 | 1 | titanic-passengers | 93.5 | |||
51 | 0 | female | 110152 | S | 0 | 2016-09-20 15:34:51.313 | 258 | 30.0 | B77 | 1 | titanic-passengers | 86.5 | |||
52 | 0 | female | 110152 | S | 0 | 2016-09-20 15:34:51.313 | 760 | 33.0 | B77 | 1 | titanic-passengers | 86.5 | |||
53 | 0 | female | PC 17569 | C | 1 | 2016-09-20 15:34:51.313 | 32 | [null] | B78 | 1 | titanic-passengers | 146.5208 | |||
54 | 0 | female | 110152 | S | 0 | 2016-09-20 15:34:51.313 | 505 | 16.0 | B79 | 1 | titanic-passengers | 86.5 | |||
55 | 0 | female | PC 17569 | C | 0 | 2016-09-20 15:34:51.313 | 196 | 58.0 | B80 | 1 | titanic-passengers | 146.5208 | |||
56 | 0 | male | PC 17593 | C | 0 | 2016-09-20 15:34:51.313 | 790 | 46.0 | B82 B84 | 1 | titanic-passengers | 79.2 | |||
57 | 0 | male | PC 17593 | C | 0 | 2016-09-20 15:34:51.313 | 140 | 24.0 | B86 | 1 | titanic-passengers | 79.2 | |||
58 | 0 | male | 112059 | S | 0 | 2016-09-20 15:34:51.313 | 264 | 40.0 | B94 | 1 | titanic-passengers | 0.0 | |||
59 | 2 | male | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 803 | 11.0 | B96 B98 | 1 | titanic-passengers | 120.0 | |||
60 | 2 | female | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 436 | 14.0 | B96 B98 | 1 | titanic-passengers | 120.0 | |||
61 | 2 | male | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 391 | 36.0 | B96 B98 | 1 | titanic-passengers | 120.0 | |||
62 | 2 | female | 113760 | S | 1 | 2016-09-20 15:34:51.313 | 764 | 36.0 | B96 B98 | 1 | titanic-passengers | 120.0 | |||
63 | 0 | female | 11769 | S | 2 | 2016-09-20 15:34:51.313 | 572 | 53.0 | C101 | 1 | titanic-passengers | 51.4792 | |||
64 | 0 | female | 113783 | S | 0 | 2016-09-20 15:34:51.313 | 12 | 58.0 | C103 | 1 | titanic-passengers | 26.55 | |||
65 | 0 | male | 113786 | S | 0 | 2016-09-20 15:34:51.313 | 450 | 52.0 | C104 | 1 | titanic-passengers | 30.5 | |||
66 | 0 | male | 19988 | S | 0 | 2016-09-20 15:34:51.313 | 299 | [null] | C106 | 1 | titanic-passengers | 30.5 | |||
67 | 0 | male | 110465 | S | 0 | 2016-09-20 15:34:51.313 | 111 | 47.0 | C110 | 1 | titanic-passengers | 52.0 | |||
68 | 0 | male | 113051 | C | 0 | 2016-09-20 15:34:51.313 | 453 | 30.0 | C111 | 1 | titanic-passengers | 27.75 | |||
69 | 1 | male | PC 17596 | C | 0 | 2016-09-20 15:34:51.313 | 274 | 37.0 | C118 | 1 | titanic-passengers | 29.7 | |||
70 | 0 | female | 113803 | S | 1 | 2016-09-20 15:34:51.313 | 4 | 35.0 | C123 | 1 | titanic-passengers | 53.1 | |||
71 | 0 | male | 113803 | S | 1 | 2016-09-20 15:34:51.313 | 138 | 37.0 | C123 | 1 | titanic-passengers | 53.1 | |||
72 | 0 | male | 113043 | S | 0 | 2016-09-20 15:34:51.313 | 332 | 45.5 | C124 | 1 | titanic-passengers | 28.5 | |||
73 | 0 | male | 113028 | S | 0 | 2016-09-20 15:34:51.313 | 712 | [null] | C124 | 1 | titanic-passengers | 26.55 | |||
74 | 0 | female | PC 17582 | S | 0 | 2016-09-20 15:34:51.313 | 610 | 40.0 | C125 | 1 | titanic-passengers | 153.4625 | |||
75 | 1 | female | PC 17582 | S | 0 | 2016-09-20 15:34:51.313 | 269 | 58.0 | C125 | 1 | titanic-passengers | 153.4625 | |||
76 | 0 | male | 19996 | S | 1 | 2016-09-20 15:34:51.313 | 713 | 48.0 | C126 | 1 | titanic-passengers | 52.0 | |||
77 | 0 | female | 19996 | S | 1 | 2016-09-20 15:34:51.313 | 670 | [null] | C126 | 1 | titanic-passengers | 52.0 | |||
78 | 0 | male | 113510 | S | 0 | 2016-09-20 15:34:51.313 | 352 | [null] | C128 | 1 | titanic-passengers | 35.0 | |||
79 | 0 | male | 111369 | C | 0 | 2016-09-20 15:34:51.313 | 890 | 26.0 | C148 | 1 | titanic-passengers | 30.0 | |||
80 | 0 | female | 113776 | S | 1 | 2016-09-20 15:34:51.313 | 152 | 22.0 | C2 | 1 | titanic-passengers | 66.6 | |||
81 | 0 | male | 113776 | S | 1 | 2016-09-20 15:34:51.313 | 337 | 29.0 | C2 | 1 | titanic-passengers | 66.6 | |||
82 | 2 | male | 113781 | S | 1 | 2016-09-20 15:34:51.313 | 306 | 0.92 | C22 C26 | 1 | titanic-passengers | 151.55 | |||
83 | 2 | female | 113781 | S | 1 | 2016-09-20 15:34:51.313 | 298 | 2.0 | C22 C26 | 1 | titanic-passengers | 151.55 | |||
84 | 2 | female | 113781 | S | 1 | 2016-09-20 15:34:51.313 | 499 | 25.0 | C22 C26 | 1 | titanic-passengers | 151.55 | |||
85 | 2 | male | 19950 | S | 3 | 2016-09-20 15:34:51.313 | 28 | 19.0 | C23 C25 C27 | 1 | titanic-passengers | 263.0 | |||
86 | 2 | female | 19950 | S | 3 | 2016-09-20 15:34:51.313 | 89 | 23.0 | C23 C25 C27 | 1 | titanic-passengers | 263.0 | |||
87 | 2 | female | 19950 | S | 3 | 2016-09-20 15:34:51.313 | 342 | 24.0 | C23 C25 C27 | 1 | titanic-passengers | 263.0 | |||
88 | 4 | male | 19950 | S | 1 | 2016-09-20 15:34:51.313 | 439 | 64.0 | C23 C25 C27 | 1 | titanic-passengers | 263.0 | |||
89 | 0 | male | 113787 | S | 0 | 2016-09-20 15:34:51.313 | 493 | 55.0 | C30 | 1 | titanic-passengers | 30.5 | |||
90 | 0 | female | PC 17760 | C | 0 | 2016-09-20 15:34:51.313 | 326 | 36.0 | C32 | 1 | titanic-passengers | 135.6333 | |||
91 | 0 | female | PC 17757 | C | 0 | 2016-09-20 15:34:51.313 | 717 | 38.0 | C45 | 1 | titanic-passengers | 227.525 | |||
92 | 0 | male | 19877 | S | 1 | 2016-09-20 15:34:51.313 | 742 | 36.0 | C46 | 1 | titanic-passengers | 78.85 | |||
93 | 0 | male | 11774 | C | 0 | 2016-09-20 15:34:51.313 | 840 | [null] | C47 | 1 | titanic-passengers | 29.7 | |||
94 | 0 | female | PC 17595 | C | 0 | 2016-09-20 15:34:51.313 | 178 | 50.0 | C49 | 1 | titanic-passengers | 28.7125 | |||
95 | 1 | female | 11767 | C | 0 | 2016-09-20 15:34:51.313 | 880 | 56.0 | C50 | 1 | titanic-passengers | 83.1583 | |||
96 | 0 | male | 110564 | S | 0 | 2016-09-20 15:34:51.313 | 431 | 28.0 | C52 | 1 | titanic-passengers | 26.55 | |||
97 | 0 | male | 19947 | S | 0 | 2016-09-20 15:34:51.313 | 56 | [null] | C52 | 1 | titanic-passengers | 35.5 | |||
98 | 0 | female | 11767 | C | 0 | 2016-09-20 15:34:51.313 | 311 | 24.0 | C54 | 1 | titanic-passengers | 83.1583 | |||
99 | 0 | female | PC 17757 | C | 1 | 2016-09-20 15:34:51.313 | 701 | 18.0 | C62 C64 | 1 | titanic-passengers | 227.525 | |||
100 | 0 | female | PC 17758 | C | 1 | 2016-09-20 15:34:51.313 | 308 | 17.0 | C65 | 1 | titanic-passengers | 108.9 |
Out[11]:
Rows: 1-100 of 891 | Columns: 15
In [14]:
# Ingesting the JSON file, using some columns and
# renaming some columns
read_json("titanic.json",
table_name = "titanic_dataset",
schema = "public",
usecols = ["fields.fare", "fields.sex"],
new_name = {"fields.fare": "fare",
"fields.sex": "sex"})
The table "public"."titanic_dataset" has been successfully created.