nodes: 0, module; 1, function_definition; 2, function_name:extract_features; 3, parameters; 4, block; 5, identifier:timeseries_container; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, default_parameter; 18, default_parameter; 19, default_parameter; 20, default_parameter; 21, expression_statement; 22, comment:# Always use the standardized way of storing the data.; 23, comment:# See the function normalize_input_to_internal_representation for more information.; 24, expression_statement; 25, comment:# Use the standard setting if the user did not supply ones himself.; 26, if_statement; 27, comment:# If requested, do profiling (advanced feature); 28, if_statement; 29, with_statement; 30, comment:# Turn off profiling if it was turned on; 31, if_statement; 32, return_statement; 33, identifier:default_fc_parameters; 34, None; 35, identifier:kind_to_fc_parameters; 36, None; 37, identifier:column_id; 38, None; 39, identifier:column_sort; 40, None; 41, identifier:column_kind; 42, None; 43, identifier:column_value; 44, None; 45, identifier:chunksize; 46, attribute; 47, identifier:n_jobs; 48, attribute; 49, identifier:show_warnings; 50, attribute; 51, identifier:disable_progressbar; 52, attribute; 53, identifier:impute_function; 54, attribute; 55, identifier:profile; 56, attribute; 57, identifier:profiling_filename; 58, attribute; 59, identifier:profiling_sorting; 60, attribute; 61, identifier:distributor; 62, None; 63, comment:"""
      Extract features from
  
      * a :class:`pandas.DataFrame` containing the different time series
  
      or
  
      * a dictionary of :class:`pandas.DataFrame` each containing one type of time series
  
      In both cases a :class:`pandas.DataFrame` with the calculated features will be returned.
  
      For a list of all the calculated time series features, please see the
      :class:`~tsfresh.feature_extraction.settings.ComprehensiveFCParameters` class,
      which is used to control which features with which parameters are calculated.
  
      For a detailed explanation of the different parameters and data formats please see :ref:`data-formats-label`.
  
      Examples
      ========
  
      >>> from tsfresh.examples import load_robot_execution_failures
      >>> from tsfresh import extract_features
      >>> df, _ = load_robot_execution_failures()
      >>> X = extract_features(df, column_id='id', column_sort='time')
  
      :param timeseries_container: The pandas.DataFrame with the time series to compute the features for, or a
              dictionary of pandas.DataFrames.
      :type timeseries_container: pandas.DataFrame or dict
  
      :param default_fc_parameters: mapping from feature calculator names to parameters. Only those names
             which are keys in this dict will be calculated. See the class:`ComprehensiveFCParameters` for
             more information.
      :type default_fc_parameters: dict
  
      :param kind_to_fc_parameters: mapping from kind names to objects of the same type as the ones for
              default_fc_parameters. If you put a kind as a key here, the fc_parameters
              object (which is the value), will be used instead of the default_fc_parameters. This means that kinds, for
              which kind_of_fc_parameters doe not have any entries, will be ignored by the feature selection.
      :type kind_to_fc_parameters: dict
  
      :param column_id: The name of the id column to group by.
      :type column_id: str
  
      :param column_sort: The name of the sort column.
      :type column_sort: str
  
      :param column_kind: The name of the column keeping record on the kind of the value.
      :type column_kind: str
  
      :param column_value: The name for the column keeping the value itself.
      :type column_value: str
  
      :param n_jobs: The number of processes to use for parallelization. If zero, no parallelization is used.
      :type n_jobs: int
  
      :param chunksize: The size of one chunk that is submitted to the worker
          process for the parallelisation.  Where one chunk is defined as a
          singular time series for one id and one kind. If you set the chunksize
          to 10, then it means that one task is to calculate all features for 10
          time series.  If it is set it to None, depending on distributor,
          heuristics are used to find the optimal chunksize. If you get out of
          memory exceptions, you can try it with the dask distributor and a
          smaller chunksize.
      :type chunksize: None or int
  
      :param: show_warnings: Show warnings during the feature extraction (needed for debugging of calculators).
      :type show_warnings: bool
  
      :param disable_progressbar: Do not show a progressbar while doing the calculation.
      :type disable_progressbar: bool
  
      :param impute_function: None, if no imputing should happen or the function to call for imputing.
      :type impute_function: None or callable
  
      :param profile: Turn on profiling during feature extraction
      :type profile: bool
  
      :param profiling_sorting: How to sort the profiling results (see the documentation of the profiling package for
             more information)
      :type profiling_sorting: basestring
  
      :param profiling_filename: Where to save the profiling results.
      :type profiling_filename: basestring
  
      :param distributor: Advanced parameter: set this to a class name that you want to use as a
               distributor. See the utilities/distribution.py for more information. Leave to None, if you want
               TSFresh to choose the best distributor.
      :type distributor: class
  
      :return: The (maybe imputed) DataFrame containing extracted features.
      :rtype: pandas.DataFrame
      """; 64, assignment; 65, boolean_operator; 66, block; 67, elif_clause; 68, identifier:profile; 69, block; 70, with_clause; 71, block; 72, identifier:profile; 73, block; 74, identifier:result; 75, identifier:defaults; 76, identifier:CHUNKSIZE; 77, identifier:defaults; 78, identifier:N_PROCESSES; 79, identifier:defaults; 80, identifier:SHOW_WARNINGS; 81, identifier:defaults; 82, identifier:DISABLE_PROGRESSBAR; 83, identifier:defaults; 84, identifier:IMPUTE_FUNCTION; 85, identifier:defaults; 86, identifier:PROFILING; 87, identifier:defaults; 88, identifier:PROFILING_FILENAME; 89, identifier:defaults; 90, identifier:PROFILING_SORTING; 91, pattern_list; 92, line_continuation:\; 93, call; 94, comparison_operator:default_fc_parameters is None; 95, comparison_operator:kind_to_fc_parameters is None; 96, expression_statement; 97, boolean_operator; 98, block; 99, expression_statement; 100, with_item; 101, if_statement; 102, expression_statement; 103, comment:# Impute the result if requested; 104, if_statement; 105, expression_statement; 106, identifier:df_melt; 107, identifier:column_id; 108, identifier:column_kind; 109, identifier:column_value; 110, attribute; 111, argument_list; 112, identifier:default_fc_parameters; 113, None; 114, identifier:kind_to_fc_parameters; 115, None; 116, assignment; 117, comparison_operator:default_fc_parameters is None; 118, comparison_operator:kind_to_fc_parameters is not None; 119, expression_statement; 120, assignment; 121, call; 122, not_operator; 123, block; 124, else_clause; 125, assignment; 126, comparison_operator:impute_function is not None; 127, block; 128, call; 129, identifier:dataframe_functions; 130, identifier:_normalize_input_to_internal_representation; 131, keyword_argument; 132, keyword_argument; 133, keyword_argument; 134, keyword_argument; 135, keyword_argument; 136, identifier:default_fc_parameters; 137, call; 138, identifier:default_fc_parameters; 139, None; 140, identifier:kind_to_fc_parameters; 141, None; 142, assignment; 143, identifier:profiler; 144, call; 145, attribute; 146, argument_list; 147, identifier:show_warnings; 148, expression_statement; 149, block; 150, identifier:result; 151, call; 152, identifier:impute_function; 153, None; 154, expression_statement; 155, attribute; 156, argument_list; 157, identifier:timeseries_container; 158, identifier:timeseries_container; 159, identifier:column_id; 160, identifier:column_id; 161, identifier:column_kind; 162, identifier:column_kind; 163, identifier:column_sort; 164, identifier:column_sort; 165, identifier:column_value; 166, identifier:column_value; 167, identifier:ComprehensiveFCParameters; 168, argument_list; 169, identifier:default_fc_parameters; 170, dictionary; 171, attribute; 172, argument_list; 173, identifier:warnings; 174, identifier:catch_warnings; 175, call; 176, expression_statement; 177, identifier:_do_extraction; 178, argument_list; 179, call; 180, identifier:profiling; 181, identifier:end_profiling; 182, identifier:profiler; 183, keyword_argument; 184, keyword_argument; 185, identifier:profiling; 186, identifier:start_profiling; 187, attribute; 188, argument_list; 189, call; 190, keyword_argument; 191, keyword_argument; 192, keyword_argument; 193, keyword_argument; 194, keyword_argument; 195, keyword_argument; 196, keyword_argument; 197, keyword_argument; 198, keyword_argument; 199, keyword_argument; 200, identifier:impute_function; 201, argument_list; 202, identifier:filename; 203, identifier:profiling_filename; 204, identifier:sorting; 205, identifier:profiling_sorting; 206, identifier:warnings; 207, identifier:simplefilter; 208, string:"ignore"; 209, attribute; 210, argument_list; 211, identifier:df; 212, identifier:df_melt; 213, identifier:column_id; 214, identifier:column_id; 215, identifier:column_value; 216, identifier:column_value; 217, identifier:column_kind; 218, identifier:column_kind; 219, identifier:n_jobs; 220, identifier:n_jobs; 221, identifier:chunk_size; 222, identifier:chunksize; 223, identifier:disable_progressbar; 224, identifier:disable_progressbar; 225, identifier:default_fc_parameters; 226, identifier:default_fc_parameters; 227, identifier:kind_to_fc_parameters; 228, identifier:kind_to_fc_parameters; 229, identifier:distributor; 230, identifier:distributor; 231, identifier:result; 232, identifier:warnings; 233, identifier:simplefilter; 234, string:"default"
code: def extract_features(timeseries_container, default_fc_parameters=None,
                       kind_to_fc_parameters=None,
                       column_id=None, column_sort=None, column_kind=None, column_value=None,
                       chunksize=defaults.CHUNKSIZE,
                       n_jobs=defaults.N_PROCESSES, show_warnings=defaults.SHOW_WARNINGS,
                       disable_progressbar=defaults.DISABLE_PROGRESSBAR,
                       impute_function=defaults.IMPUTE_FUNCTION,
                       profile=defaults.PROFILING,
                       profiling_filename=defaults.PROFILING_FILENAME,
                       profiling_sorting=defaults.PROFILING_SORTING,
                       distributor=None):
      """
      Extract features from
  
      * a :class:`pandas.DataFrame` containing the different time series
  
      or
  
      * a dictionary of :class:`pandas.DataFrame` each containing one type of time series
  
      In both cases a :class:`pandas.DataFrame` with the calculated features will be returned.
  
      For a list of all the calculated time series features, please see the
      :class:`~tsfresh.feature_extraction.settings.ComprehensiveFCParameters` class,
      which is used to control which features with which parameters are calculated.
  
      For a detailed explanation of the different parameters and data formats please see :ref:`data-formats-label`.
  
      Examples
      ========
  
      >>> from tsfresh.examples import load_robot_execution_failures
      >>> from tsfresh import extract_features
      >>> df, _ = load_robot_execution_failures()
      >>> X = extract_features(df, column_id='id', column_sort='time')
  
      :param timeseries_container: The pandas.DataFrame with the time series to compute the features for, or a
              dictionary of pandas.DataFrames.
      :type timeseries_container: pandas.DataFrame or dict
  
      :param default_fc_parameters: mapping from feature calculator names to parameters. Only those names
             which are keys in this dict will be calculated. See the class:`ComprehensiveFCParameters` for
             more information.
      :type default_fc_parameters: dict
  
      :param kind_to_fc_parameters: mapping from kind names to objects of the same type as the ones for
              default_fc_parameters. If you put a kind as a key here, the fc_parameters
              object (which is the value), will be used instead of the default_fc_parameters. This means that kinds, for
              which kind_of_fc_parameters doe not have any entries, will be ignored by the feature selection.
      :type kind_to_fc_parameters: dict
  
      :param column_id: The name of the id column to group by.
      :type column_id: str
  
      :param column_sort: The name of the sort column.
      :type column_sort: str
  
      :param column_kind: The name of the column keeping record on the kind of the value.
      :type column_kind: str
  
      :param column_value: The name for the column keeping the value itself.
      :type column_value: str
  
      :param n_jobs: The number of processes to use for parallelization. If zero, no parallelization is used.
      :type n_jobs: int
  
      :param chunksize: The size of one chunk that is submitted to the worker
          process for the parallelisation.  Where one chunk is defined as a
          singular time series for one id and one kind. If you set the chunksize
          to 10, then it means that one task is to calculate all features for 10
          time series.  If it is set it to None, depending on distributor,
          heuristics are used to find the optimal chunksize. If you get out of
          memory exceptions, you can try it with the dask distributor and a
          smaller chunksize.
      :type chunksize: None or int
  
      :param: show_warnings: Show warnings during the feature extraction (needed for debugging of calculators).
      :type show_warnings: bool
  
      :param disable_progressbar: Do not show a progressbar while doing the calculation.
      :type disable_progressbar: bool
  
      :param impute_function: None, if no imputing should happen or the function to call for imputing.
      :type impute_function: None or callable
  
      :param profile: Turn on profiling during feature extraction
      :type profile: bool
  
      :param profiling_sorting: How to sort the profiling results (see the documentation of the profiling package for
             more information)
      :type profiling_sorting: basestring
  
      :param profiling_filename: Where to save the profiling results.
      :type profiling_filename: basestring
  
      :param distributor: Advanced parameter: set this to a class name that you want to use as a
               distributor. See the utilities/distribution.py for more information. Leave to None, if you want
               TSFresh to choose the best distributor.
      :type distributor: class
  
      :return: The (maybe imputed) DataFrame containing extracted features.
      :rtype: pandas.DataFrame
      """
  
      # Always use the standardized way of storing the data.
      # See the function normalize_input_to_internal_representation for more information.
      df_melt, column_id, column_kind, column_value = \
          dataframe_functions._normalize_input_to_internal_representation(
              timeseries_container=timeseries_container,
              column_id=column_id, column_kind=column_kind,
              column_sort=column_sort,
              column_value=column_value)
      # Use the standard setting if the user did not supply ones himself.
      if default_fc_parameters is None and kind_to_fc_parameters is None:
          default_fc_parameters = ComprehensiveFCParameters()
      elif default_fc_parameters is None and kind_to_fc_parameters is not None:
          default_fc_parameters = {}
  
      # If requested, do profiling (advanced feature)
      if profile:
          profiler = profiling.start_profiling()
  
      with warnings.catch_warnings():
          if not show_warnings:
              warnings.simplefilter("ignore")
          else:
              warnings.simplefilter("default")
  
          result = _do_extraction(df=df_melt,
                                  column_id=column_id, column_value=column_value,
                                  column_kind=column_kind,
                                  n_jobs=n_jobs, chunk_size=chunksize,
                                  disable_progressbar=disable_progressbar,
                                  default_fc_parameters=default_fc_parameters,
                                  kind_to_fc_parameters=kind_to_fc_parameters,
                                  distributor=distributor)
  
          # Impute the result if requested
          if impute_function is not None:
              impute_function(result)
  
      # Turn off profiling if it was turned on
      if profile:
          profiling.end_profiling(profiler, filename=profiling_filename,
                                  sorting=profiling_sorting)
  
      return result