Closed carter54 closed 6 years ago
@carter54 can you past the full stack trace of the error? That will be helpful to see what primitive is causing this error, so we can try recreating it.
@kmax12 here are the full stack trace of the error
`
File "
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/personal_code/Featuretools/simple_demo.py", line 11, in
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\synthesis\dfs.py", line 186, in dfs verbose=verbose)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\computational_backends\calculate_feature_matrix.py", line 189, in calculate_feature_matrix target_time)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\computational_backends\calculate_feature_matrix.py", line 253, in calculate_batch _feature_matrix = calc_results(_time_last_to_calc, ids, precalculated_features=precalculated_features, training_window=window)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\computational_backends\calculate_feature_matrix.py", line 289, in wrapped r = method(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\computational_backends\calculate_feature_matrix.py", line 231, in calc_results verbose=backend_verbose)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\computational_backends\pandas_backend.py", line 163, in calculate_all_features handler(group, entity_frames)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\computational_backends\pandas_backend.py", line 253, in _calculate_transform_features values = feature_func(*variable_data)
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\primitives\transform_primitive.py", line 216, in
File "C:\ProgramData\Anaconda3\lib\site-packages\featuretools-0.1.16-py3.6.egg\featuretools\primitives\transform_primitive.py", line 534, in inner return getattr(pd_index, time_unit).values
AttributeError: 'numpy.ndarray' object has no attribute 'values'`
@carter54 thanks. that is helpful.
We are trying to reproduce, but unable to.
Is there any chance you can share a piece of code that reproduces it? If you don't want to share publically, my gmail is in my profile.
@kmax12 I just followed the very simple example in the README.md
import featuretools as ft
es = ft.demo.load_mock_customer(return_entityset=True)
feature_matrix, features_defs = ft.dfs(entityset=es, target_entity="customers")
feature_matrix.head(5)
nothing else. When I delete the '.values' in 'getattr(pd_index, time_unit).values within 'transform_primitive.py', everything works all right.
I see. I am able to run that exact code using using python 3.6.4 and featuretools 0.1.16.
Perhaps you have a conflicting package installed. Can you run pip freeze
and send what it outputs?
Closing this for now. If you have additional information on how to reproduce, would be happy to help! Thanks
Hi @kmax12,
I encountered the same error when I tried to use training_window in dfs function and I fixed it by removing the '.values' in 'getattr(pd_index, time_unit).values'. :)
Thanks @SauceCat! I can now reproduce this with pandas version 0.19.2. We actually require pandas pandas>=0.20.3
in our requirements.txt
. Is it possible something else that was installed after featuretools overwrote the pandas you were using?
Anyways, you should be able to fix by running pip install 'pandas>=0.20.3'
.
@Seth-Rothschild yes, exactly. Thanks!
should we delete the '.values' in 'getattr(pd_index, time_unit).values', otherwise I get the error of 'AttributeError: 'numpy.ndarray' object has no attribute 'values'' in this line.