After downloading and installing Statistics and running mean(), MethodError appears.

Asked 2 years ago, Updated 2 years ago, 79 views

The language used is Julia and the version is 1.6.3.
I write and execute the code according to the book, but I don't know how to solve it because I got a MethodError.

using Pkg
Pkg.add ("Statistics")

Downloaded and installed the package in .Then

using Statistics
mean([1,2,3,4,5])

after running
MethodError: no method matching mean(::Vector {Int64})
Closeest candidates are:
  mean(::Any, !Matched::Any) at c:\Users\~\Julia Study\benkyou1.ipynb:1

That's what happened.
I don't know what the problem is and how to solve it.Thank you for your cooperation.

julia

2022-09-30 14:15

1 Answers

I don't know what it means, but I reset all the outputs, started VSCode again, and then ran it again, and it worked normally.


2022-09-30 14:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.