Comments (8)
This could be an issue with your Python version. I was experiencing the same issue with Python 3.8. I downgraded to Python 3.7 and have been able to execute the same code successfully.
from tsfresh.
I am also having this issue. I'm running Python 3.9.7 on a Mac M1 chip. I also confirm that it works when using MinimalFCParameters
from tsfresh.
Same issue happens by following condition.
Python 3.8.13.
tsfresh 0.19.0 pypi_0 pypi
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/opt/conda/envs/py38/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/utilities/distribution.py", line 43, in _function_with_partly_reduce
results = list(itertools.chain.from_iterable(results))
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/utilities/distribution.py", line 42, in
results = (map_function(chunk, **kwargs) for chunk in chunk_list)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/extraction.py", line 386, in _do_extraction_on_chunk
return list(_f())
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/extraction.py", line 364, in _f
result = func(x, param=parameter_list)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/feature_calculators.py", line 2103, in friedrich_coefficients
calculated[m][r] = _estimate_friedrich_coefficients(x, m, r)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/feature_calculators.py", line 152, in _estimate_friedrich_coefficients
df["quantiles"] = pd.qcut(df.signal, r)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/pandas/core/reshape/tile.py", line 377, in qcut
bins = np.quantile(x_np, quantiles)
File "<array_function internals>", line 180, in quantile
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4412, in quantile
return _quantile_unchecked(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4424, in _quantile_unchecked
r, k = _ureduce(a,
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 3725, in _ureduce
r = func(a, **kwargs)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4593, in _quantile_ureduce_func
result = _quantile(arr,
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4704, in _quantile
previous = np.take(arr, previous_indexes, axis=DATA_AXIS)
File "<array_function internals>", line 180, in take
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 190, in take
return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "5j_Model_lightGBM_v9.py", line 25, in
X = extract_features(df_train_feature,
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/extraction.py", line 164, in extract_features
result = _do_extraction(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/extraction.py", line 294, in _do_extraction
result = distributor.map_reduce(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/utilities/distribution.py", line 241, in map_reduce
result = list(itertools.chain.from_iterable(result))
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tqdm/std.py", line 1195, in iter
for obj in iterable:
File "/opt/conda/envs/py38/lib/python3.8/multiprocessing/pool.py", line 868, in next
raise value
File "/opt/conda/envs/py38/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/utilities/distribution.py", line 43, in _function_with_partly_reduce
results = list(itertools.chain.from_iterable(results))
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/utilities/distribution.py", line 42, in
results = (map_function(chunk, **kwargs) for chunk in chunk_list)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/extraction.py", line 386, in _do_extraction_on_chunk
return list(_f())
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/extraction.py", line 364, in _f
result = func(x, param=parameter_list)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/feature_calculators.py", line 2103, in friedrich_coefficients
calculated[m][r] = _estimate_friedrich_coefficients(x, m, r)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/tsfresh/feature_extraction/feature_calculators.py", line 152, in _estimate_friedrich_coefficients
df["quantiles"] = pd.qcut(df.signal, r)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/pandas/core/reshape/tile.py", line 377, in qcut
bins = np.quantile(x_np, quantiles)
File "<array_function internals>", line 180, in quantile
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4412, in quantile
return _quantile_unchecked(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4424, in _quantile_unchecked
r, k = _ureduce(a,
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 3725, in _ureduce
r = func(a, **kwargs)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4593, in _quantile_ureduce_func
result = _quantile(arr,
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4704, in _quantile
previous = np.take(arr, previous_indexes, axis=DATA_AXIS)
File "<array_function internals>", line 180, in take
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 190, in take
return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.
from tsfresh.
Hi @adalli13, @masa8. Thanks for bringing this problem to our attention. Which pandas version are you using? And would you be able to provide an example DataFrame to reproduce the problem?
from tsfresh.
I used pandas 1.4.2 as described in my original request. Unfortunately, I do not have access anymore to my original code where I tried the feature so that I cannot provide an example data frame, sorry.
from tsfresh.
I wanted to use the library again in a different setting and encountered the same issue. I was also able to reproduce the same error with a very small example:
import random
import pandas as pd
dates = pd.date_range("2022-06-12", "2022-12-20")
values_1 = [random.randint(0, 200) for x in range(len(dates))]
test_df = pd.DataFrame(values_1, index=dates)
tsfresh.extract_features(test_df.reset_index(), column_id="index")
My current environment is:
- Python 3.9.13 on Mac M1 (conda environment, installed using pip)
- tsfresh=0.19.0
- pandas= 1.5.2
- numpy= 1.23.5
from tsfresh.
Thank you @adalli13 for the bug report and sorry for the delay! I can reproduce the issue. I am working on a solution.
from tsfresh.
Sorry for the wrong information @adalli13 - the issue has been fixed in version 0.20.0 https://tsfresh.readthedocs.io/en/latest/changes.html#version-0-20-0
from tsfresh.
Related Issues (20)
- shuffle_transfer failed during shuffle c1992000bcde9deee65a2332ab4614a2 HOT 3
- Can Not Rolling With Binary Feature HOT 2
- tsfresh 0.20.0: TypeError exception with Pandas 2.0.0 HOT 3
- support of python 3.10 HOT 2
- Debugging tsfresh methods from Notebook freezes whole process HOT 4
- Example Provided in doc doesn't work HOT 1
- Quick start example fails due to TypeError in Setting MultiIndex HOT 1
- During the feature extraction process, how could I set the param from a subset of another columns. HOT 1
- TypeError: acf() got an unexpected keyword argument 'unbiased' HOT 11
- 05 Timeseries Forecasting (multiple ids).ipynb doesn't work as written HOT 2
- Problem with the function extract_features HOT 7
- Feature calculator return type documentation HOT 2
- extract_relevant_features hangs on specific data HOT 1
- number_of_maxima only returns maxima of last key in the dictionary. HOT 2
- Feature selection taking magnitutes longer than it should HOT 8
- Look-Ahead Bias in Generated Features HOT 4
- id column in the result of make_forecasting_frame have only (id, ?) as identifier HOT 4
- roll time series only give "step by step window" for max_timeshift window, but have left alone windows from 1 to max_timeshift window? HOT 1
- Cannot run dask_feature_extraction_on_chunk
- AttributeError: `np.PINF` was removed in the NumPy 2.0 release. Use `np.inf` instead. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsfresh.