Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'numpy.ndarray' object has no attribute '__dict__' #10

Open
Podolchak opened this issue Jun 9, 2024 · 0 comments
Open

Comments

@Podolchak
Copy link

Podolchak commented Jun 9, 2024

I'm getting an error, but I'm definitely transmitting everything normally

Node v22.2.0
Python 3.11

async function trendDirection(numbers) {
let X = numbers.map((, i) => [i])
let y = numbers
console.log(X, y)
let model = new sklearn.LinearRegression()
await model.init(py)
const model_data = await model.fit({ X, y })
let trend = model_data.coef
[0] > 0 ? 1 : model_data.coef_[0] < 0 ? -1 : 0
return trend
}
// LOG
[ [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] [ 69361.6, 69363.9, 69362.7, 69362.8, 69362.7 ]

/node_modules/@fisch0920/python-bridge/node_python_bridge.py", line 81, in default\n' +
' return o.dict\n' +
' ^^^^^^^^^^\n',
"AttributeError: 'numpy.ndarray' object has no attribute 'dict'\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant