MCPcopy
hub / github.com/pathwaycom/pathway / empty

Method empty

python/pathway/internals/table.py:362–383  ·  view source on GitHub ↗

Creates an empty table with a schema specified by kwargs. Args: kwargs: Dict whose keys are column names and values are column types. Returns: Table: Created empty table. Example: >>> import pathway as pw >>> t1 = pw.Table.empty(ag

(**kwargs: dt.DType)

Source from the content-addressed store, hash-verified

360 @staticmethod
361 @check_arg_types
362 def empty(**kwargs: dt.DType) -> Table:
363 """Creates an empty table with a schema specified by kwargs.
364
365 Args:
366 kwargs: Dict whose keys are column names and values are column types.
367
368 Returns:
369 Table: Created empty table.
370
371
372 Example:
373
374 >>> import pathway as pw
375 >>> t1 = pw.Table.empty(age=float, pet=float)
376 >>> pw.debug.compute_and_print(t1, include_id=False)
377 age | pet
378 """
379 from pathway.internals import table_io
380
381 ret = table_io.empty_from_schema(schema_from_types(None, **kwargs))
382 ret._universe.register_as_empty(no_warn=True)
383 return ret
384
385 @trace_user_frame
386 @desugar

Calls 2

schema_from_typesFunction · 0.90
register_as_emptyMethod · 0.45