method collect()
method distinct()
addresses.
addresses
CA
method group_by()
- group_by(
base table): group a component view by their respective base table rows - group_by(
expr, …): group by the given expressions
grouping_items(Any): expressions to group by
DataFrame: A new DataFrame with the specified group-by clause.
method head()
n(int, default:10): Number of rows to select. Default is 10.
DataFrameResultSet: A DataFrameResultSet with the first n rows of the DataFrame.
method join()
-
other(catalog.Table): the table to join with -
on(exprs.Expr | Sequence[exprs.ColumnRef] | None): the join condition, which can be either a) references to one or more columns or b) a boolean expression. -
column references: implies an equality predicate that matches columns in both this DataFrame and
otherby name.- column in
other: A column with that same name must be present in this DataFrame, and it must be unique (otherwise the join is ambiguous). - column in this DataFrame: A column with that same name must be present in
other.
- column in
- boolean expression: The expressions must be valid in the context of the joined tables.
-
how(plan.JoinType.LiteralType, default:inner): the type of join to perform. -
'inner': only keep rows that have a match in both -
'left': keep all rows from this DataFrame and only matching rows from the other table -
'right': keep all rows from the other table and only matching rows from this DataFrame -
'full_outer': keep all rows from both this DataFrame and the other table -
'cross': Cartesian product; nooncondition allowed
DataFrame: A new DataFrame.
on=t3.id here,
because that would be ambiguous, since both t1 and t2 have a column named id):
method limit()
n(int): Number of rows to select.
DataFrame: A new DataFrame with the specified limited rows.
method order_by()
-
expr_list(exprs.Expr): expressions to order by -
asc(bool, default:True): whether to order in ascending order (True) or descending order (False). Default is True.
DataFrame: A new DataFrame with the specified order-by clause.
method sample()
n: the total number of rows to produce as a samplen_per_stratum: the number of rows to produce per stratum as a samplefraction: the fraction of available rows to produce as a sample
-
n(int | None): Total number of rows to produce as a sample. -
n_per_stratum(int | None): Number of rows to produce per stratum as a sample. This parameter is only valid ifstratify_byis specified. Only one ofnorn_per_stratumcan be specified. -
fraction(float | None): Fraction of available rows to produce as a sample. This parameter is not usable withnorn_per_stratum. The fraction must be between 0.0 and 1.0. -
seed(int | None): Random seed for reproducible shuffling -
stratify_by(Any): If specified, the sample will be stratified by these values.
DataFrame: A new DataFrame which specifies the sampled rows
person containing the field ‘age’, we can create samples of the table in various ways:
Sample 100 rows from the above Table:
method select()
-
items(Any): expressions to be selected -
named_items(Any): named expressions to be selected
DataFrame: A new DataFrame with the specified select list.
age >= 18 where ‘age’ is
another column in table t:
method show()
method tail()
n(int, default:10): Number of rows to select. Default is 10.
DataFrameResultSet: A DataFrameResultSet with the last n rows of the DataFrame.
method to_coco_dataset()
Path: Path to the COCO dataset file.
method to_pytorch_dataset()
image_format(str, default:pt): format of the images. Can be ‘pt’ (pytorch tensor) or ‘np’ (numpy array). ‘np’ means image columns return as an RGB uint8 array of shape HxWxC. ‘pt’ means image columns return as a CxHxW tensor with values in [0,1] and type torch.float32. (the format output by torchvision.transforms.ToTensor())
'torch.utils.data.IterableDataset': A pytorch IterableDataset: Columns become fields of the dataset, where rows are returned as a dictionary compatible with torch.utils.data.DataLoader default collation.
method where()
pred(exprs.Expr): the predicate to filter rows
DataFrame: A new DataFrame with the specified predicates replacing the where-clause.