Got error TypeError: 'numpy.ndarray' object is not callable


I try to use panda by using this code

dat = pd.DataFrame()
return_data = dat.values().T

And I got error

Traceback (most recent call last)
    Input In [27], in <cell line: 1>()
    ----> 1 return_data = dat.values().T
    TypeError: 'numpy.ndarray' object is not callable

Try to solve the errors and no idea about error

Asked By: Red Harry



Replace dat.values().T by dat.values.T. This error happens when you call a numpy array as function.

Answered By: romain gal
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.