<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Example of extracting features from dataframes with Datetime indices
Assuming that time-varying measurements are taken at regular intervals can be sufficient for many situations. However, for a large number of tasks it is important to take into account when a measurement is made. An example can be healthcare, where the interval between measurements of vital signs contains crucial information. 
Tsfresh now supports calculator functions that use the index of the timeseries container in order to calculate the features. The only requirements for these function is that the index of the input dataframe is of type pd.DatetimeIndex. These functions are contained in the new class TimeBasedFCParameters.
Note that the behaviour of all other functions is unaffected. The settings parameter of extract_features() can contain both index-dependent functions and 'regular' functions.
Step1:  Build a time series container with Datetime indices
Let's build a dataframe with a datetime index. The format must be with a value and a kind column, since each measurement has its own timestamp - i.e. measurements are not assumed to be simultaneous.
Step2:  Right now TimeBasedFCParameters only contains linear_trend_timewise, which performs a calculation of a linear trend, but using the time difference in hours between measurements in order to perform the linear regression. As always, you can add your own functions in tsfresh/feature_extraction/feature_calculators.py.
Step3:  We extract the features as usual, specifying the column value, kind, and id.
Step4:  The output looks exactly, like usual. If we compare it with the 'regular' linear_trend feature calculator, we can see that the intercept, p and R values are the same, as we'd expect – only the slope is now different.
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
from tsfresh.feature_extraction import extract_features
# TimeBasedFCParameters contains all functions that use the Datetime index of the timeseries container
from tsfresh.feature_extraction.settings import TimeBasedFCParameters  
Explanation: Example of extracting features from dataframes with Datetime indices
Assuming that time-varying measurements are taken at regular intervals can be sufficient for many situations. However, for a large number of tasks it is important to take into account when a measurement is made. An example can be healthcare, where the interval between measurements of vital signs contains crucial information. 
Tsfresh now supports calculator functions that use the index of the timeseries container in order to calculate the features. The only requirements for these function is that the index of the input dataframe is of type pd.DatetimeIndex. These functions are contained in the new class TimeBasedFCParameters.
Note that the behaviour of all other functions is unaffected. The settings parameter of extract_features() can contain both index-dependent functions and 'regular' functions.
End of explanation
df = pd.DataFrame({"id": ["a", "a", "a", "a", "b", "b", "b", "b"], 
                   "value": [1, 2, 3, 1, 3, 1, 0, 8],
                   "kind": ["temperature", "temperature", "pressure", "pressure",
                            "temperature", "temperature", "pressure", "pressure"]},
                   index=pd.DatetimeIndex(
                       ['2019-03-01 10:04:00', '2019-03-01 10:50:00', '2019-03-02 00:00:00', '2019-03-02 09:04:59',
                        '2019-03-02 23:54:12', '2019-03-03 08:13:04', '2019-03-04 08:00:00', '2019-03-04 08:01:00']
                   ))
df = df.sort_index()
df
Explanation: Build a time series container with Datetime indices
Let's build a dataframe with a datetime index. The format must be with a value and a kind column, since each measurement has its own timestamp - i.e. measurements are not assumed to be simultaneous.
End of explanation
settings_time = TimeBasedFCParameters()
settings_time
Explanation: Right now TimeBasedFCParameters only contains linear_trend_timewise, which performs a calculation of a linear trend, but using the time difference in hours between measurements in order to perform the linear regression. As always, you can add your own functions in tsfresh/feature_extraction/feature_calculators.py.
End of explanation
X_tsfresh = extract_features(df, column_id="id", column_value='value', column_kind='kind',
                             default_fc_parameters=settings_time)
X_tsfresh.head()
Explanation: We extract the features as usual, specifying the column value, kind, and id.
End of explanation
settings_regular = {'linear_trend': [
  {'attr': 'pvalue'},
  {'attr': 'rvalue'},
  {'attr': 'intercept'},
  {'attr': 'slope'},
  {'attr': 'stderr'}
]}
X_tsfresh = extract_features(df, column_id="id", column_value='value', column_kind='kind',
                             default_fc_parameters=settings_regular)
X_tsfresh.head()
Explanation: The output looks exactly, like usual. If we compare it with the 'regular' linear_trend feature calculator, we can see that the intercept, p and R values are the same, as we'd expect – only the slope is now different.
End of explanation
<END_TASK>