vDataFrame.to_db

In [ ]:
vDataFrame.to_db(name: str,
                 usecols: list = [],
                 relation_type: str = "view",
                 inplace: bool = False,
                 db_filter = "",
                 nb_split: int = 0)

Saves the vDataFrame current relation to the Vertica Database. This method can also be used to materialize flex tables.

Parameters

Name Type Optional Description
name
str
❌
Name of the relation. To save the relation in a specific schema you can write '"my_schema"."my_relation"'. Use double quotes '"' to avoid errors due to special characters.
usecols
list
✓
vcolumns to select from the final vDataFrame relation. If empty, all the columns will be selected.
relation_type
str
✓
Type of the relation.
  • view : View
  • table : Table
  • temporary : Temporary Table
  • insert : Inserts into an existing table
inplace
bool
✓
If set to True, the vDataFrame will be replaced using the new relation.
db_filter
str / list
✓
Filter used before creating the relation in the DB. It can be a list of conditions or an expression. This parameter is very useful to create train and test sets on TS.
nb_split
int
✓
If this parameter is greater than 0, it will add to the final relation a new column '_vertica_ml\_python\_split_' which will contain values in [0;nb_split - 1] where each category will represent approximately 1 / nb_split of the entire distribution.

Returns

vDataFrame : self

Example

In [99]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
# Doing some transformations
titanic.get_dummies()
titanic.normalize()
123
fare
Float
123
Float
Abc
sex
Varchar(20)
Abc
boat
Varchar(100)
123
pclass
Float
123
age
Float
Abc
ticket
Varchar(36)
Abc
Varchar(164)
Abc
embarked
Varchar(20)
Abc
cabin
Varchar(30)
123
body
Float
123
Float
Abc
home.dest
Varchar(100)
123
Float
123
Float
123
pclass_1
Float
123
Float
123
Float
123
embarked_Q
Float
123
parch_0
Float
123
Float
123
Float
123
Float
123
Float
123
Float
123
Float
123
Float
123
sibsp_1
Float
123
Float
123
Float
123
Float
123
Float
12.2335228377568673306163744003female[null]-1.52458485653939825566284767748-1.9502503129565278908367342155113781SC22 C26[null]Montreal, PQ / Chesterville, ON1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
22.2335228377568673306163744003male[null]-1.52458485653939825566284767748-0.0105614239550127329564098413113781SC22 C26-0.30177333429701812091999864Montreal, PQ / Chesterville, ON1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
32.2335228377568673306163744003female[null]-1.52458485653939825566284767748-0.3569344398481404397207534796113781SC22 C26[null]Montreal, PQ / Chesterville, ON1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
4-0.6451344183800711827483251581male[null]-1.524584856539398255662847677480.6129100046526171392194087075112050SA36[null]Belfast, NI1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
50.2951864297839290254556257484male[null]-1.524584856539398255662847677482.8296973063686344625112079923PC 17609C[null]-1.47183603843091257442431516Montevideo, Uruguay1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
63.6766504196440590399722506719male[null]-1.524584856539398255662847677481.1671068300816214700423585287PC 17757CC62 C64-0.41567324354899014736732149New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
7-0.1526950296281732549424535906male[null]-1.52458485653939825566284767748[null]PC 17318S[null][null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
84.0564660234861111358187558479male[null]-1.52458485653939825566284767748-0.4262090430267659810736222072PC 17558CB58 B60[null]Montreal, PQ1.718351957456489070218766430323-0.30642369222116871970059157132-1.82404116243169099688897026934-0.57150400207205686533461107422
90.7840642993307746538800662293maleA-1.524584856539398255662847677480.405086195116740515160802524613050CC6[null]Winnipeg, MN1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
10-0.1512704219461523351898811560male[null]-1.52458485653939825566284767748-0.356934439848140439720753479613905C[null]-0.16716435063559663511861709San Francisco, CA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
110.0291798844431641668026272294male[null]-1.524584856539398255662847677481.0285576237243703873366210734113784ST[null]Trenton, NJ1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
12-0.1408232989446655903376833021male[null]-1.524584856539398255662847677480.8207338141884937632780148905110489SD22[null]London / Winnipeg, MB1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
13-0.0657939610248971500355350787male[null]-1.524584856539398255662847677480.7514592110098682219251461628113054SA21[null]Pomeroy, WA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
140.3140216428171549458109700973male[null]-1.524584856539398255662847677481.2363814332602470113952272564PC 17591CB100.45410788164788714550314389Omaha, NE1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
150.1070584377269744466099203220male[null]-1.52458485653939825566284767748[null]112379C[null][null]Philadelphia, PA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
16-0.1408232989446655903376833021male[null]-1.524584856539398255662847677481.0285576237243703873366210734113050SB38[null]Washington, DC1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
17-0.0562965764780910183517188479male[null]-1.52458485653939825566284767748[null]113798S[null][null][null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
18-0.5501605729120098659101628500male[null]-1.524584856539398255662847677480.1972623855808638911021963416695SB51 B53 B55[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
190.2495192059290664218671637842male[null]-1.52458485653939825566284767748-0.1491106303122638156621472966113059S[null][null]Montevideo, Uruguay1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
200.2495192059290664218671637842male[null]-1.52458485653939825566284767748-0.9111312652771447705437033008113059S[null][null]Montevideo, Uruguay1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
21-0.1512704219461523351898811560male[null]-1.524584856539398255662847677481.305656036438872552748095984019924S[null][null]Ascot, Berkshire / Rochester, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
220.8526031246512557837894944406male[null]-1.524584856539398255662847677480.405086195116740515160802524619877SC460.08134454227779687713008730Little Onn Hall, Staffs1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
230.5168705809216590287665906814male[null]-1.524584856539398255662847677481.0978322269029959286894898011W.E.P. 5734SE31[null]Amenia, ND1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
24-0.6451344183800711827483251581male[null]-1.52458485653939825566284767748[null]112051S[null][null]Liverpool, England / Belfast1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
251.9529549024289393108657488362male[null]-1.52458485653939825566284767748-0.218385233490889357015016024313508CC89[null]Los Angeles, CA1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
260.3425935744877665123685628461male[null]-1.52458485653939825566284767748[null]110465SA14[null]Stoughton, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
27-0.1591057641972673938290295464male[null]-1.524584856539398255662847677481.16710683008162147004235852875727SE58[null]Victoria, BC1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
280.9344382883372654980562653750male[null]-1.524584856539398255662847677480.4743607982953660565136712522PC 17756CE52[null]Lakewood, NJ1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
29-0.1408232989446655903376833021male[null]-1.52458485653939825566284767748[null]113791S[null][null]Roachdale, IN1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
300.7034941872663995163535796169male[null]-1.524584856539398255662847677482.7604227031900089211583392647WE/P 5735SB221.08573465113609565580193423Milwaukee, WI1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
310.7088754053506198705656298932male[null]-1.524584856539398255662847677480.6129100046526171392194087075PC 17599CC85[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
320.3425935744877665123685628461male[null]-1.524584856539398255662847677480.0587131792236128083964588863F.C. 12750SB71[null]Montreal, PQ1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
331.3763838824076139461519595697male[null]-1.524584856539398255662847677481.3749306396174980941009647117PC 17761CC86-1.05765455024192338734314117Deephaven, MN / Cedar Rapids, IA1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
34-0.0809897762997869607296410480male[null]-1.524584856539398255662847677480.6129100046526171392194087075PC 17580CA18-0.32248240870646758027405734Philadelphia, PA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
35-0.0433953293097095690724228800female[null]-1.524584856539398255662847677480.4050861951167405151608025246PC 17531CA29[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
363.5675102753859816971145080739male[null]-1.52458485653939825566284767748[null]PC 17483SC95[null][null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
37-0.1180295760323308742965243482male[null]-1.52458485653939825566284767748-0.0105614239550127329564098413113051CC111[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
384.3504898532399540829390122478male[null]-1.52458485653939825566284767748-0.772582058919893687837965845519950SC23 C25 C27[null]Winnipeg, MB1.718351957456489070218766430323-0.30642369222116871970059157132-1.82404116243169099688897026934-0.57150400207205686533461107422
394.3504898532399540829390122478male[null]-1.524584856539398255662847677482.344775084118255673041126898819950SC23 C25 C27[null]Winnipeg, MB1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
40-0.1408232989446655903376833021male[null]-1.52458485653939825566284767748[null]113778SD34[null]Westcliff-on-Sea, Essex1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
41-0.6451344183800711827483251581male[null]-1.52458485653939825566284767748[null]112058SB102[null][null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
420.3634878204907400020729585539male[null]-1.524584856539398255662847677480.4743607982953660565136712522113803SC123[null]Scituate, MA1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
430.0861641917240009569055246142male[null]-1.524584856539398255662847677481.1671068300816214700423585287111320SE631.14786187436444403386411033St Anne's-on-Sea, Lancashire1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
440.8592512938340200759681658021male[null]-1.52458485653939825566284767748-0.4262090430267659810736222072PC 17593CB86[null][null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
450.0131141087437869144462836933male[null]-1.524584856539398255662847677482.8296973063686344625112079923PC 17754CA5[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
462.2698503336484007843069714832male[null]-1.524584856539398255662847677480.5436354014739915978665399799PC 17582SC91-0.17751888784032136479564644Winnipeg, MB1.718351957456489070218766430323-0.30642369222116871970059157132-1.82404116243169099688897026934-0.57150400207205686533461107422
470.8592512938340200759681658021male[null]-1.524584856539398255662847677481.0978322269029959286894898011PC 17593CB82 B84[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
480.1602437911890887840392912145male[null]-1.52458485653939825566284767748[null]113796S[null][null][null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
490.9404539317092125018647945756male[null]-1.524584856539398255662847677481.028557623724370387336621073436973SC83[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
50-0.6451344183800711827483251581male[null]-1.524584856539398255662847677480.6821846078312426805722774352112059SB94-0.56063676441513636284573238[null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
511.1308764918726754421253100033male[null]-1.524584856539398255662847677481.721303655510625800865308349912749SB691.47920706491563538352904952Montreal, PQ1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
520.1621432680984500103760544607male[null]-1.524584856539398255662847677480.8207338141884937632780148905113038SB11[null]London / Middlesex1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
530.3399817937373948261555133826male[null]-1.52458485653939825566284767748[null]17463SE46[null]Brighton, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
540.3046040363005419856332979228male[null]-1.524584856539398255662847677481.7213036555106258008653083499680SC39[null]London / Birmingham1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
550.3425935744877665123685628461male[null]-1.524584856539398255662847677480.8207338141884937632780148905113789S[null]-1.30616344315531689959184557New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
56-0.0620747852363678688681526427male14-1.52458485653939825566284767748[null]PC 17600C[null][null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
57-0.0997471107797290708051781039female[null]-1.524584856539398255662847677481.3749306396174980941009647117PC 17595CC49[null]Paris, France New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
58-0.1512704219461523351898811560male[null]-1.524584856539398255662847677481.0978322269029959286894898011694S[null]-0.87127288055687825315661288Bennington, VT1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
59-0.1512704219461523351898811560male[null]-1.524584856539398255662847677481.3749306396174980941009647117113044SE60[null]London1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
603.3722592449189225195059404744male[null]-1.524584856539398255662847677480.1626250839915511204257619778113503CC132-1.23368168272224379185264012[null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
61-0.0809897762997869607296410480male[null]-1.524584856539398255662847677481.929127465046502424923914532911771CB370.97183474188412362935461138Buffalo, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
620.3399817937373948261555133826male[null]-1.524584856539398255662847677480.751459211009868221925146162817464SD21[null]Southington / Noank, CT1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
63-0.1408232989446655903376833021male[null]-1.52458485653939825566284767748[null]113028SC124[null]Portland, OR1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
64-0.1185842232898643523868592161male[null]-1.52458485653939825566284767748[null]PC 17612C[null][null]Chicago, IL1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
65-0.0752913455717032817193513095male[null]-1.52458485653939825566284767748-0.0798360271336382743092785690113501SD6-0.39496416913954068801326279Springfield, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
660.2191275753792868004789518456male[null]-1.52458485653939825566284767748-0.0105614239550127329564098413113801S[null][null]London / New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
67-0.1512704219461523351898811560male[null]-1.52458485653939825566284767748-0.0105614239550127329564098413110469SC106[null]Brockton, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
680.3634878204907400020729585539male[null]-1.52458485653939825566284767748-0.7725820589198936878379658455113773SD30[null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
690.7840642993307746538800662293male[null]-1.524584856539398255662847677481.097832226902995928689489801113050CC61.32388900684476443837360928Vancouver, BC1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
700.3399817937373948261555133826male[null]-1.524584856539398255662847677481.652029052332000259512439622317463SE460.11240815389197106616117535Dorchester, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
710.9156809538573233879807283191male[null]-1.52458485653939825566284767748-0.1491106303122638156621472966PC 17604C[null][null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
72-0.1408232989446655903376833021male[null]-1.524584856539398255662847677482.414049687296881214393995626413509SE380.87864390704160106226134724East Bridgewater, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
731.0643948000450325203385963876male[null]-1.524584856539398255662847677480.959283020545744845983752345819928QC780.68190770015183119839778959Fond du Lac, WI1.7183519574564890702187664303233.260810611561116812951182479210.54778896869655520601485651247-0.57150400207205686533461107422
74-0.0657939610248971500355350787male[null]-1.524584856539398255662847677481.7213036555106258008653083499113787SC30[null]Montreal, PQ1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
750.1602437911890887840392912145male[null]-1.524584856539398255662847677481.1671068300816214700423585287113796S[null][null]Washington, DC1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
76-0.0809897762997869607296410480male[null]-1.524584856539398255662847677480.4743607982953660565136712522PC 17596CC118[null]Brooklyn, NY1.718351957456489070218766430323-0.30642369222116871970059157132-1.82404116243169099688897026934-0.57150400207205686533461107422
771.5064980506988579502202419318male[null]-1.524584856539398255662847677481.929127465046502424923914532935273CD48-0.43638231795843960672138019Lexington, MA1.718351957456489070218766430323-0.30642369222116871970059157132-1.82404116243169099688897026934-0.57150400207205686533461107422
78-0.1512704219461523351898811560male[null]-1.524584856539398255662847677482.3447750841182556730411268988693S[null]1.02360742790774727773975813Isle of Wight, England1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
790.5321461742267420109668407071male[null]-1.524584856539398255662847677482.4140496872968812143939956264113509CB300.72332584897073011710590699Providence, RI1.718351957456489070218766430323-0.30642369222116871970059157132-1.82404116243169099688897026934-0.57150400207205686533461107422
80-0.1185842232898643523868592161male[null]-1.52458485653939825566284767748-0.1144733287229510449857129328PC 17562CD430.25737167475811728163958625?Havana, Cuba1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
81-0.6451344183800711827483251581male[null]-1.52458485653939825566284767748[null]112052S[null][null]Belfast1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
82-0.1037834992121216767708000020male[null]-1.524584856539398255662847677481.0631949253136831580130554372113043SC1240.01921731904944849906791120Surbiton Hill, Surrey1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
831.1308764918726754421253100033male[null]-1.52458485653939825566284767748-0.495483646205391522426490934912749SB24[null]Montreal, PQ1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
840.6199172032545055575359967857male[null]-1.52458485653939825566284767748-0.0798360271336382743092785690113776SC2[null]Isleworth, England1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
851.4233959359143042979868499122male[null]-1.52458485653939825566284767748-0.8418566620985192291908345731PC 17758CC65[null]Madrid, Spain1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
860.3425935744877665123685628461male[null]-1.524584856539398255662847677481.1671068300816214700423585287110465SC1100.44375334444316241582611455Worcester, MA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
87-0.6451344183800711827483251581male[null]-1.524584856539398255662847677480.543635401473991597866539979919972S[null][null]Rotterdam, Netherlands1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
881.9311887965245690182727787985male[null]-1.52458485653939825566284767748-0.5647582493840170637793596625PC 17760C[null]0.70261677456128065775184829[null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
893.6766504196440590399722506719male[null]-1.52458485653939825566284767748[null]PC 17757C[null][null][null]1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
900.3140216428171549458109700973male[null]-1.524584856539398255662847677480.0587131792236128083964588863PC 17590SA24[null]Trenton, NJ1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
910.3046040363005419856332979228male[null]-1.52458485653939825566284767748[null]113767SA32[null]Seattle, WA1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
920.1170306915011208848779273644male[null]-1.524584856539398255662847677480.405086195116740515160802524613049CA10[null]Winnipeg, MB1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
930.4831548657804972612890430621male[null]-1.524584856539398255662847677481.7213036555106258008653083499PC 17603C[null][null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
94-0.1408232989446655903376833021male[null]-1.524584856539398255662847677480.1972623855808638911021963416113790S[null]-0.57099130161986109252276173London1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
954.3386181225564464183342419593male[null]-1.524584856539398255662847677482.1369512745823790489825207158PC 17608CB57 B59 B63 B66[null]Haverford, PA / Cooperstown, NY1.718351957456489070218766430323-0.30642369222116871970059157132-1.824041162431690996888970269341.74835105897043756352888762989
960.4166731739528543395023294464male[null]-1.524584856539398255662847677481.374930639617498094100964711713507SE44[null]Duluth, MN1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
97-0.1408232989446655903376833021male[null]-1.524584856539398255662847677481.7905782586892513422181770776113792S[null][null]New York, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
98-0.0620747852363678688681526427male[null]-1.524584856539398255662847677481.790578258689251342218177077617764CA7[null]St James, Long Island, NY1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
990.4945517272366646193096225390male[null]-1.52458485653939825566284767748-0.426209043026765981073622207213695SC31[null]Huntington, WV1.718351957456489070218766430323-0.306423692221168719700591571320.547788968696555206014856512471.74835105897043756352888762989
100-0.1512704219461523351898811560male[null]-1.52458485653939825566284767748[null]113056SA19[null]Streatham, Surrey1.718351957456489070218766430323-0.306423692221168719700591571320.54778896869655520601485651247-0.57150400207205686533461107422
Out[99]:
Rows: 1-100 of 1234 | Columns: 32
In [102]:
# Saving the result in the Database
from verticapy import *
titanic.to_db(name = '"public"."titanic_normalized"',
              usecols = ["fare", "sex", "survived"],
              relation_type = "table")
vDataFrame('"public"."titanic_normalized"')
123
fare
Numeric(46,28)
123
Numeric(63,30)
Abc
sex
Varchar(20)
1[null]male
2-0.6451344183800711827483251581male
3-0.6451344183800711827483251581male
4-0.6451344183800711827483251581male
5-0.6451344183800711827483251581male
6-0.6451344183800711827483251581male
7-0.6451344183800711827483251581male
8-0.6451344183800711827483251581male
9-0.6451344183800711827483251581male
10-0.6451344183800711827483251581male
11-0.6451344183800711827483251581male
12-0.6451344183800711827483251581male
13-0.6451344183800711827483251581male
14-0.6451344183800711827483251581male
15-0.6451344183800711827483251581male
16-0.6451344183800711827483251581male
17-0.5849058045380454180622361488male
18-0.5689179073919519759856999059male
19-0.5501605729120098659101628500male
20-0.5266545461586646899927176788male
21-0.5228555923399422373191911865male
22-0.5228555923399422373191911865male
23-0.5228555923399422373191911865male
24-0.5226181577262720840270957807male
25-0.5217481973017846423648582139male
26-0.5217481973017846423648582139male
27-0.5217481973017846423648582139male
28-0.5169197269981884050168060422male
29-0.5148625935053501968940914466male
30-0.5131207731794659523432795499male
31-0.5126459039521256457590887383male
32-0.5126459039521256457590887383male
33-0.5121710347247853391748979268female
34-0.5121710347247853391748979268male
35-0.5113010743002978975126603601male
36-0.5112212962701047260065163037male
37-0.5112212962701047260065163037male
38-0.5112212962701047260065163037male
39-0.5112212962701047260065163037male
40-0.5112212962701047260065163037male
41-0.5112212962701047260065163037male
42-0.5112212962701047260065163037male
43-0.5112212962701047260065163037male
44-0.5112212962701047260065163037male
45-0.5111415182399115545003722474male
46-0.5111415182399115545003722474male
47-0.5097966885880838062539438691male
48-0.5097966885880838062539438691male
49-0.5097966885880838062539438691male
50-0.5097966885880838062539438691male
51-0.5094794759442204814557044070male
52-0.5078972116787225799171806229female
53-0.5078972116787225799171806229male
54-0.5078972116787225799171806229male
55-0.5078972116787225799171806229male
56-0.5078972116787225799171806229male
57-0.5078972116787225799171806229male
58-0.5078972116787225799171806229male
59-0.5078972116787225799171806229male
60-0.5078972116787225799171806229male
61-0.5078972116787225799171806229male
62-0.5078972116787225799171806229male
63-0.5078972116787225799171806229male
64-0.5078972116787225799171806229male
65-0.5078972116787225799171806229male
66-0.5078972116787225799171806229male
67-0.5078972116787225799171806229male
68-0.5078972116787225799171806229male
69-0.5078972116787225799171806229male
70-0.5078174336485294084110365666female
71-0.5078174336485294084110365666female
72-0.5078174336485294084110365666female
73-0.5078174336485294084110365666female
74-0.5078174336485294084110365666male
75-0.5078174336485294084110365666male
76-0.5078174336485294084110365666male
77-0.5078174336485294084110365666male
78-0.5078174336485294084110365666male
79-0.5078174336485294084110365666male
80-0.5078174336485294084110365666male
81-0.5078174336485294084110365666male
82-0.5078174336485294084110365666male
83-0.5078174336485294084110365666male
84-0.5078174336485294084110365666male
85-0.5078174336485294084110365666male
86-0.5078174336485294084110365666male
87-0.5078174336485294084110365666male
88-0.5078174336485294084110365666male
89-0.5078174336485294084110365666male
90-0.5078174336485294084110365666male
91-0.5078174336485294084110365666male
92-0.5078174336485294084110365666male
93-0.5074223424513822733329898114female
94-0.5074223424513822733329898114male
95-0.5074223424513822733329898114male
96-0.5074223424513822733329898114male
97-0.5074223424513822733329898114male
98-0.5074223424513822733329898114male
99-0.5074223424513822733329898114male
100-0.5074223424513822733329898114male
Out[102]:
Rows: 1-100 of 1234 | Columns: 3
In [104]:
# Adding a split column in the final relation
titanic.to_db(name = '"public"."titanic_normalized"',
              usecols = ["fare", "sex", "survived"],
              relation_type = "table",
              nb_split = 3)
vDataFrame('"public"."titanic_normalized"')
123
fare
Numeric(46,28)
123
Numeric(63,30)
Abc
sex
Varchar(20)
123
_verticapy_split_
Int
1[null]male1
2-0.6451344183800711827483251581male0
3-0.6451344183800711827483251581male0
4-0.6451344183800711827483251581male0
5-0.6451344183800711827483251581male0
6-0.6451344183800711827483251581male0
7-0.6451344183800711827483251581male1
8-0.6451344183800711827483251581male1
9-0.6451344183800711827483251581male1
10-0.6451344183800711827483251581male1
11-0.6451344183800711827483251581male2
12-0.6451344183800711827483251581male2
13-0.6451344183800711827483251581male2
14-0.6451344183800711827483251581male2
15-0.6451344183800711827483251581male0
16-0.6451344183800711827483251581male0
17-0.5849058045380454180622361488male2
18-0.5689179073919519759856999059male0
19-0.5501605729120098659101628500male0
20-0.5266545461586646899927176788male1
21-0.5228555923399422373191911865male0
22-0.5228555923399422373191911865male1
23-0.5228555923399422373191911865male2
24-0.5226181577262720840270957807male0
25-0.5217481973017846423648582139male0
26-0.5217481973017846423648582139male1
27-0.5217481973017846423648582139male2
28-0.5169197269981884050168060422male0
29-0.5148625935053501968940914466male1
30-0.5131207731794659523432795499male1
31-0.5126459039521256457590887383male0
32-0.5126459039521256457590887383male1
33-0.5121710347247853391748979268female0
34-0.5121710347247853391748979268male0
35-0.5113010743002978975126603601male0
36-0.5112212962701047260065163037male0
37-0.5112212962701047260065163037male0
38-0.5112212962701047260065163037male0
39-0.5112212962701047260065163037male1
40-0.5112212962701047260065163037male1
41-0.5112212962701047260065163037male2
42-0.5112212962701047260065163037male2
43-0.5112212962701047260065163037male2
44-0.5112212962701047260065163037male0
45-0.5111415182399115545003722474male2
46-0.5111415182399115545003722474male2
47-0.5097966885880838062539438691male0
48-0.5097966885880838062539438691male2
49-0.5097966885880838062539438691male2
50-0.5097966885880838062539438691male2
51-0.5094794759442204814557044070male1
52-0.5078972116787225799171806229female1
53-0.5078972116787225799171806229male0
54-0.5078972116787225799171806229male0
55-0.5078972116787225799171806229male1
56-0.5078972116787225799171806229male1
57-0.5078972116787225799171806229male1
58-0.5078972116787225799171806229male1
59-0.5078972116787225799171806229male1
60-0.5078972116787225799171806229male2
61-0.5078972116787225799171806229male2
62-0.5078972116787225799171806229male2
63-0.5078972116787225799171806229male2
64-0.5078972116787225799171806229male2
65-0.5078972116787225799171806229male2
66-0.5078972116787225799171806229male2
67-0.5078972116787225799171806229male2
68-0.5078972116787225799171806229male2
69-0.5078972116787225799171806229male0
70-0.5078174336485294084110365666female0
71-0.5078174336485294084110365666female0
72-0.5078174336485294084110365666female1
73-0.5078174336485294084110365666female2
74-0.5078174336485294084110365666male0
75-0.5078174336485294084110365666male0
76-0.5078174336485294084110365666male0
77-0.5078174336485294084110365666male0
78-0.5078174336485294084110365666male0
79-0.5078174336485294084110365666male0
80-0.5078174336485294084110365666male0
81-0.5078174336485294084110365666male1
82-0.5078174336485294084110365666male1
83-0.5078174336485294084110365666male1
84-0.5078174336485294084110365666male1
85-0.5078174336485294084110365666male1
86-0.5078174336485294084110365666male1
87-0.5078174336485294084110365666male1
88-0.5078174336485294084110365666male2
89-0.5078174336485294084110365666male2
90-0.5078174336485294084110365666male0
91-0.5078174336485294084110365666male0
92-0.5078174336485294084110365666male0
93-0.5074223424513822733329898114female2
94-0.5074223424513822733329898114male0
95-0.5074223424513822733329898114male0
96-0.5074223424513822733329898114male0
97-0.5074223424513822733329898114male0
98-0.5074223424513822733329898114male0
99-0.5074223424513822733329898114male1
100-0.5074223424513822733329898114male1
Out[104]:
Rows: 1-100 of 1234 | Columns: 4
In [106]:
# Using conditions to filter data
titanic.to_db(name = '"public"."titanic_normalized"',
              usecols = ["fare", "sex", "survived"],
              relation_type = "table",
              db_filter = "sex = 'female'")
vDataFrame('"public"."titanic_normalized"')
123
fare
Numeric(46,28)
123
Numeric(63,30)
Abc
sex
Varchar(20)
1-0.5121710347247853391748979268female
2-0.5078972116787225799171806229female
3-0.5078174336485294084110365666female
4-0.5078174336485294084110365666female
5-0.5078174336485294084110365666female
6-0.5078174336485294084110365666female
7-0.5074223424513822733329898114female
8-0.5067898166405649849628476504female
9-0.5027534282081723789972257523female
10-0.5017239117232985943227000729female
11-0.5017239117232985943227000729female
12-0.5002195260110845030639835819female
13-0.5002195260110845030639835819female
14-0.4998244348139373679859368267female
15-0.4998244348139373679859368267female
16-0.4983998271319164482333643921female
17-0.4982421705484394664474130427female
18-0.4982421705484394664474130427female
19-0.4981623925182462949412689864female
20-0.4979249579045761416491735806female
21-0.4979249579045761416491735806female
22-0.4979249579045761416491735806female
23-0.4979249579045761416491735806female
24-0.4979249579045761416491735806female
25-0.4979249579045761416491735806female
26-0.4979249579045761416491735806female
27-0.4979249579045761416491735806female
28-0.4979249579045761416491735806female
29-0.4979249579045761416491735806female
30-0.4979249579045761416491735806female
31-0.4979249579045761416491735806female
32-0.4979249579045761416491735806female
33-0.4979249579045761416491735806female
34-0.4979249579045761416491735806female
35-0.4979249579045761416491735806female
36-0.4979249579045761416491735806female
37-0.4979249579045761416491735806female
38-0.4979249579045761416491735806female
39-0.4974500886772358350649827690female
40-0.4974500886772358350649827690female
41-0.4974500886772358350649827690female
42-0.4974500886772358350649827690female
43-0.4974500886772358350649827690female
44-0.4974500886772358350649827690female
45-0.4973703106470426635588387127female
46-0.4972126540635656817728873633female
47-0.4959457029650217438062662781female
48-0.4959457029650217438062662781female
49-0.4959457029650217438062662781female
50-0.4959457029650217438062662781female
51-0.4959457029650217438062662781female
52-0.4959457029650217438062662781female
53-0.4954708337376814372220754665female
54-0.4954708337376814372220754665female
55-0.4954708337376814372220754665female
56-0.4954708337376814372220754665female
57-0.4954708337376814372220754665female
58-0.4951555205707274736501727677female
59-0.4946008733131939955598378998female
60-0.4946008733131939955598378998female
61-0.4946008733131939955598378998female
62-0.4946008733131939955598378998female
63-0.4946008733131939955598378998female
64-0.4946008733131939955598378998female
65-0.4946008733131939955598378998female
66-0.4922265271764924626388838421female
67-0.4922265271764924626388838421female
68-0.4922265271764924626388838421female
69-0.4922265271764924626388838421female
70-0.4922265271764924626388838421female
71-0.4922265271764924626388838421female
72-0.4910393541081416961784068132female
73-0.4905644848808013895942160017female
74-0.4805922311066549513262089594female
75-0.4805922311066549513262089594female
76-0.4805922311066549513262089594female
77-0.4805922311066549513262089594female
78-0.4805922311066549513262089594female
79-0.4801971399095078162481622042female
80-0.4770307119016026519447778728female
81-0.4748938003785712723159192209female
82-0.4675333273547965202609616420female
83-0.4651589812180949873400075843female
84-0.4630220696950636077111489324female
85-0.4630220696950636077111489324female
86-0.4585108120353306951613362227female
87-0.4585108120353306951613362227female
88-0.4582733774216605418692408169female
89-0.4581935993914673703630967606female
90-0.4464016467381528772644705284female
91-0.4464016467381528772644705284female
92-0.4456893428971424173881843111female
93-0.4456893428971424173881843111female
94-0.4456893428971424173881843111female
95-0.4456893428971424173881843111female
96-0.4456893428971424173881843111female
97-0.4456893428971424173881843111female
98-0.4456893428971424173881843111female
99-0.4456893428971424173881843111female
100-0.4453721302532790925899448490female
Out[106]:
Rows: 1-100 of 420 | Columns: 3
In [108]:
# Using multiple conditions to filter data
titanic.to_db(name = '"public"."titanic_normalized"',
              usecols = ["fare", "sex", "survived"],
              relation_type = "table",
              db_filter = ["sex = 'female'", "fare < 3"])
vDataFrame('"public"."titanic_normalized"')
123
fare
Numeric(46,28)
123
Numeric(63,30)
Abc
sex
Varchar(20)
1-0.5121710347247853391748979268female
2-0.5078972116787225799171806229female
3-0.5078174336485294084110365666female
4-0.5078174336485294084110365666female
5-0.5078174336485294084110365666female
6-0.5078174336485294084110365666female
7-0.5074223424513822733329898114female
8-0.5067898166405649849628476504female
9-0.5027534282081723789972257523female
10-0.5017239117232985943227000729female
11-0.5017239117232985943227000729female
12-0.5002195260110845030639835819female
13-0.5002195260110845030639835819female
14-0.4998244348139373679859368267female
15-0.4998244348139373679859368267female
16-0.4983998271319164482333643921female
17-0.4982421705484394664474130427female
18-0.4982421705484394664474130427female
19-0.4981623925182462949412689864female
20-0.4979249579045761416491735806female
21-0.4979249579045761416491735806female
22-0.4979249579045761416491735806female
23-0.4979249579045761416491735806female
24-0.4979249579045761416491735806female
25-0.4979249579045761416491735806female
26-0.4979249579045761416491735806female
27-0.4979249579045761416491735806female
28-0.4979249579045761416491735806female
29-0.4979249579045761416491735806female
30-0.4979249579045761416491735806female
31-0.4979249579045761416491735806female
32-0.4979249579045761416491735806female
33-0.4979249579045761416491735806female
34-0.4979249579045761416491735806female
35-0.4979249579045761416491735806female
36-0.4979249579045761416491735806female
37-0.4979249579045761416491735806female
38-0.4979249579045761416491735806female
39-0.4974500886772358350649827690female
40-0.4974500886772358350649827690female
41-0.4974500886772358350649827690female
42-0.4974500886772358350649827690female
43-0.4974500886772358350649827690female
44-0.4974500886772358350649827690female
45-0.4973703106470426635588387127female
46-0.4972126540635656817728873633female
47-0.4959457029650217438062662781female
48-0.4959457029650217438062662781female
49-0.4959457029650217438062662781female
50-0.4959457029650217438062662781female
51-0.4959457029650217438062662781female
52-0.4959457029650217438062662781female
53-0.4954708337376814372220754665female
54-0.4954708337376814372220754665female
55-0.4954708337376814372220754665female
56-0.4954708337376814372220754665female
57-0.4954708337376814372220754665female
58-0.4951555205707274736501727677female
59-0.4946008733131939955598378998female
60-0.4946008733131939955598378998female
61-0.4946008733131939955598378998female
62-0.4946008733131939955598378998female
63-0.4946008733131939955598378998female
64-0.4946008733131939955598378998female
65-0.4946008733131939955598378998female
66-0.4922265271764924626388838421female
67-0.4922265271764924626388838421female
68-0.4922265271764924626388838421female
69-0.4922265271764924626388838421female
70-0.4922265271764924626388838421female
71-0.4922265271764924626388838421female
72-0.4910393541081416961784068132female
73-0.4905644848808013895942160017female
74-0.4805922311066549513262089594female
75-0.4805922311066549513262089594female
76-0.4805922311066549513262089594female
77-0.4805922311066549513262089594female
78-0.4805922311066549513262089594female
79-0.4801971399095078162481622042female
80-0.4770307119016026519447778728female
81-0.4748938003785712723159192209female
82-0.4675333273547965202609616420female
83-0.4651589812180949873400075843female
84-0.4630220696950636077111489324female
85-0.4630220696950636077111489324female
86-0.4585108120353306951613362227female
87-0.4585108120353306951613362227female
88-0.4582733774216605418692408169female
89-0.4581935993914673703630967606female
90-0.4464016467381528772644705284female
91-0.4464016467381528772644705284female
92-0.4456893428971424173881843111female
93-0.4456893428971424173881843111female
94-0.4456893428971424173881843111female
95-0.4456893428971424173881843111female
96-0.4456893428971424173881843111female
97-0.4456893428971424173881843111female
98-0.4456893428971424173881843111female
99-0.4456893428971424173881843111female
100-0.4453721302532790925899448490female
Out[108]:
Rows: 1-100 of 397 | Columns: 3

See Also

vDataFrame.to_csv Creates a csv file of the current vDataFrame relation.