featuretools.primitives.IsWorkingHours#

class featuretools.primitives.IsWorkingHours(start_hour=8, end_hour=18)[source]#

Determines if a datetime falls during working hours on a 24-hour clock. Can configure start_hour and end_hour.

Parameters:
  • start_hour (int) – Start hour of workday. Must adhere to 24-hour clock. Default is 8 (8am).

  • end_hour (int) – End hour of workday. Must adhere to 24-hour clock. Default is 18 (6pm).

Examples

>>> import numpy as np
>>> from datetime import datetime
>>> dates = [datetime(2022, 6, 21, 16, 3, 3),
...          datetime(2019, 1, 3, 4, 4, 4),
...          datetime(2022, 1, 1, 12, 1, 2),
...          np.nan]
>>> is_working_hour = IsWorkingHours()
>>> is_working_hour(dates).tolist()
[True, False, True, False]
>>> is_working_hour = IsWorkingHours(15, 17)
>>> is_working_hour(dates).tolist()
[True, False, False, False]
__init__(start_hour=8, end_hour=18)[source]#

Methods

__init__([start_hour, end_hour])

flatten_nested_input_types(input_types)

Flattens nested column schema inputs into a single list.

generate_name(base_feature_names)

generate_names(base_feature_names)

get_args_string()

get_arguments()

get_description(input_column_descriptions[, ...])

get_filepath(filename)

get_function()

Attributes

base_of

base_of_exclude

commutative

compatibility

Additional compatible libraries

default_value

Default value this feature returns if no data found.

description_template

input_types

woodwork.ColumnSchema types of inputs

max_stack_depth

name

Name of the primitive

number_output_features

Number of columns in feature matrix associated with this feature

return_type

ColumnSchema type of return

series_library

stack_on

stack_on_exclude

stack_on_self

uses_calc_time

uses_full_dataframe