You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to run your example code, but it returned an error.
Here is the code that I executed :
`from tsfresh.examples.robot_execution_failures import download_robot_execution_failures,
load_robot_execution_failures
download_robot_execution_failures()
timeseries, y = load_robot_execution_failures()
from tsfresh import extract_features
extracted_features = extract_features(timeseries, column_id="id", column_sort="time")
`
Here is the returned error :
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/tsfresh/feature_extraction/extraction.py:164, in extract_features(timeseries_container, default_fc_parameters, kind_to_fc_parameters, column_id, column_sort, column_kind, column_value, chunksize, n_jobs, show_warnings, disable_progressbar, impute_function, profile, profiling_filename, profiling_sorting, distributor, pivot)
161 else:
162 warnings.simplefilter("default")
--> 164 result = _do_extraction(
165 df=timeseries_container,
166 column_id=column_id,
167 column_value=column_value,
168 column_kind=column_kind,
169 column_sort=column_sort,
170 n_jobs=n_jobs,
171 chunk_size=chunksize,
172 disable_progressbar=disable_progressbar,
173 show_warnings=show_warnings,
174 default_fc_parameters=default_fc_parameters,
175 kind_to_fc_parameters=kind_to_fc_parameters,
176 distributor=distributor,
177 pivot=pivot,
178 )
180 # Impute the result if requested
181 if impute_function is not None:
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/tsfresh/feature_extraction/extraction.py:304, in _do_extraction(df, column_id, column_value, column_kind, column_sort, default_fc_parameters, kind_to_fc_parameters, n_jobs, chunk_size, disable_progressbar, show_warnings, distributor, pivot)
301 if not pivot:
302 return result
--> 304 return_df = data.pivot(result)
305 return return_df
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/tsfresh/feature_extraction/data.py:94, in PartitionedTsData.pivot(self, results)
91 return_df = pd.DataFrame(return_df_dict, dtype=float)
93 # copy the type of the index
---> 94 return_df.index = return_df.index.astype(self.df_id_type)
96 # Sort by index to be backward compatible
97 return_df = return_df.sort_index()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pandas/core/indexes/multi.py:3638, in MultiIndex.astype(self, dtype, copy)
3636 raise NotImplementedError(msg)
3637 if not is_object_dtype(dtype):
-> 3638 raise TypeError(
3639 "Setting a MultiIndex dtype to anything other than object "
3640 "is not supported"
3641 )
3642 if copy is True:
3643 return self._view()
TypeError: Setting a MultiIndex dtype to anything other than object is not supported
`
Environment:
Python version: 3.8
Operating System: Linux
tsfresh version: 0.20.0
Install method (conda, pip, source): pip
The text was updated successfully, but these errors were encountered:
Thanks @bbacasonati!
Are you by chance using pandas >= 2.0?
I have just released tsfresh version 0.20.1 which fixes this incompatibility with pandas 2.0.
Could you try again?
The problem:
Hi!
I tried to run your example code, but it returned an error.
Here is the code that I executed :
`from tsfresh.examples.robot_execution_failures import download_robot_execution_failures,
load_robot_execution_failures
download_robot_execution_failures()
timeseries, y = load_robot_execution_failures()
from tsfresh import extract_features
extracted_features = extract_features(timeseries, column_id="id", column_sort="time")
`
Here is the returned error :
`
Feature Extraction: 100%|██████████| 10/10 [00:22<00:00, 2.28s/it]
TypeError Traceback (most recent call last)
Cell In[6], line 2
1 from tsfresh import extract_features
----> 2 extracted_features = extract_features(timeseries, column_id="id", column_sort="time")
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/tsfresh/feature_extraction/extraction.py:164, in extract_features(timeseries_container, default_fc_parameters, kind_to_fc_parameters, column_id, column_sort, column_kind, column_value, chunksize, n_jobs, show_warnings, disable_progressbar, impute_function, profile, profiling_filename, profiling_sorting, distributor, pivot)
161 else:
162 warnings.simplefilter("default")
--> 164 result = _do_extraction(
165 df=timeseries_container,
166 column_id=column_id,
167 column_value=column_value,
168 column_kind=column_kind,
169 column_sort=column_sort,
170 n_jobs=n_jobs,
171 chunk_size=chunksize,
172 disable_progressbar=disable_progressbar,
173 show_warnings=show_warnings,
174 default_fc_parameters=default_fc_parameters,
175 kind_to_fc_parameters=kind_to_fc_parameters,
176 distributor=distributor,
177 pivot=pivot,
178 )
180 # Impute the result if requested
181 if impute_function is not None:
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/tsfresh/feature_extraction/extraction.py:304, in _do_extraction(df, column_id, column_value, column_kind, column_sort, default_fc_parameters, kind_to_fc_parameters, n_jobs, chunk_size, disable_progressbar, show_warnings, distributor, pivot)
301 if not pivot:
302 return result
--> 304 return_df = data.pivot(result)
305 return return_df
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/tsfresh/feature_extraction/data.py:94, in PartitionedTsData.pivot(self, results)
91 return_df = pd.DataFrame(return_df_dict, dtype=float)
93 # copy the type of the index
---> 94 return_df.index = return_df.index.astype(self.df_id_type)
96 # Sort by index to be backward compatible
97 return_df = return_df.sort_index()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pandas/core/indexes/multi.py:3638, in MultiIndex.astype(self, dtype, copy)
3636 raise NotImplementedError(msg)
3637 if not is_object_dtype(dtype):
-> 3638 raise TypeError(
3639 "Setting a MultiIndex dtype to anything other than object "
3640 "is not supported"
3641 )
3642 if copy is True:
3643 return self._view()
TypeError: Setting a MultiIndex dtype to anything other than object is not supported
`
Environment:
The text was updated successfully, but these errors were encountered: