0
$\begingroup$

I'm using the tsfresh library to extract features on my data but I keep getting an error:

ValueError: Could not guess the value column! Please hand it to the function as an argument.

In the source code for tsfresh feature extraction I see:

def _get_value_columns(df, *other_columns):
    value_columns = [col for col in df.columns if col not in other_columns]

    if len(value_columns) == 0:
        raise ValueError("Could not guess the value column! Please hand it to the function as an argument.")

    return value_columns

Which seems to indicate that my column length is 0 but when I print the length of my column, I see it is 64.

print(len(df.temperature))
[64 rows x 1 columns]
64

Here is the code I am working with:

from tsfresh import extract_features, extract_relevant_features, select_features
from tsfresh.utilities.dataframe_functions import impute

df = pandas.DataFrame(data=tempArray)
          
df.columns = ['temperature']
print(len(df.temperature))
extracted_features= extract_features(df, column_id='temperature')
impute(extracted_features)

Thanks so much!

$\endgroup$
2
  • $\begingroup$ What is the output when you check the value of df.columns? $\endgroup$ – Oxbowerce Jan 14 at 17:09
  • $\begingroup$ When I print(df.columns), I get Index(['temperature'], dtype='object') $\endgroup$ – YJay Jan 14 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.