with_column¶
- DataFrame.with_column(col, name, role=None, subroles=None, unit='', time_formats=None)[source]¶
Returns a new
View
that contains an additional column.- Args:
- col (
columns
): The column to be added.
- name (str):
Name of the new column.
- role (str, optional):
Role of the new column. Must be from
getml.data.roles
.- subroles (str, List[str] or None, optional):
Subroles of the new column. Must be from
getml.data.subroles
.- unit (str, optional):
Unit of the column.
- time_formats (str, optional):
Formats to be used to parse the time stamps.
This is only necessary, if an implicit conversion from a
StringColumn
to a time stamp is taking place.The formats are allowed to contain the following special characters:
%w - abbreviated weekday (Mon, Tue, …)
%W - full weekday (Monday, Tuesday, …)
%b - abbreviated month (Jan, Feb, …)
%B - full month (January, February, …)
%d - zero-padded day of month (01 .. 31)
%e - day of month (1 .. 31)
%f - space-padded day of month ( 1 .. 31)
%m - zero-padded month (01 .. 12)
%n - month (1 .. 12)
%o - space-padded month ( 1 .. 12)
%y - year without century (70)
%Y - year with century (1970)
%H - hour (00 .. 23)
%h - hour (00 .. 12)
%a - am/pm
%A - AM/PM
%M - minute (00 .. 59)
%S - second (00 .. 59)
%s - seconds and microseconds (equivalent to %S.%F)
%i - millisecond (000 .. 999)
%c - centisecond (0 .. 9)
%F - fractional seconds/microseconds (000000 - 999999)
%z - time zone differential in ISO 8601 format (Z or +NN.NN)
%Z - time zone differential in RFC format (GMT or +NNNN)
%% - percent sign
- col (