alteryx / alteryx/featuretools
Handle timezones in datetime indexes
- Vorherrschende Sprache
- Python
- Sterne
- 7.7k
- Forks
- 915
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Currently, entity datetime indexes must not include time zones. Deviation from this causes, [calculate_feature_matrix.py#L171](https://github.com/Featuretools/featuretools/blob/master/featuretools/computational_backends/calculate_feature_matrix.py#L171) to give a not very helpful error:
```TypeError: cutoff_time times must be datetime type: try casting via pd.to_datetime(cutoff_time['time'])```
Therefore, a cutoff dataframe below will cause an error during deep feature synthesis
```ct = pd.DataFrame()
ct['customer_id'] = [1, 2, 3]
ct['time'] = pd.to_datetime(['2014-1-1 04:00+000', '2014-1-1 04:00+000', '2014-1-1 04:00+000'])
ct['label'] = [True, True, False]
```
while this will succeed:
```ct = pd.DataFrame()
ct['customer_id'] = [1, 2, 3]
ct['time'] = pd.to_datetime(['2014-1-1 04:00', '2014-1-1 04:00', '2014-1-1 04:00'])
ct['label'] = [True, True, False]
```
It would be better if this explicitly listed allowed `pd.PandasTypes._pandas_datetimes`, or if featuretools was able to handle comparisons with datetimes including timezones.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.