to_tablesample

In [ ]:
to_tablesample(query: str,
               title: str = "")

Returns the result of a SQL query as a tablesample object.

Parameters

Name Type Optional Description
query
str
SQL Query.
title
str
Query title when the query is displayed.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [20]:
from verticapy.utilities import *
to_tablesample("SELECT * FROM public.titanic LIMIT 5")
123
pclass
Integer
123
survived
Integer
Abc
Varchar(164)
Abc
sex
Varchar(20)
123
age
Numeric(6,3)
123
sibsp
Integer
123
parch
Integer
Abc
ticket
Varchar(36)
123
fare
Numeric(10,5)
Abc
cabin
Varchar(30)
Abc
embarked
Varchar(20)
Abc
boat
Varchar(100)
123
body
Integer
Abc
home.dest
Varchar(100)
110female2.00012113781151.55000C22 C26S[null][null]Montreal, PQ / Chesterville, ON
210male30.00012113781151.55000C22 C26S[null]135Montreal, PQ / Chesterville, ON
310female25.00012113781151.55000C22 C26S[null][null]Montreal, PQ / Chesterville, ON
410male39.000001120500.00000A36S[null][null]Belfast, NI
510male71.00000PC 1760949.50420[null]C[null]22Montevideo, Uruguay
Out[20]:
Rows: 1-5 of 0 | Columns: 14

See Also

tablesample Object in memory created for rendering purposes.