Call Python function scipy.stat​s.anderson​_ksamp from Matlab 2017a with options

조회 수: 1 (최근 30일)
Eric
Eric 2017년 10월 12일
답변: Eric 2017년 10월 23일
It's straightforward to call the Python KS test from MATLAB:
foo = py.scipy.stats.ks_2samp(rand(1,50),rand(1,70));
But when I call the Anderson-Darling k-sample test this way I get one error:
bar = py.scipy.stats.anderson_ksamp(rand(1,50),rand(1,70));
"Python Error: AxisError: axis -1 is out of bounds for array of dimension 0"
and this way results in another error (here, I'm trying to set midrank = false, thinking that might be the cause of the previous error)
bar = py.scipy.stats.anderson_ksamp(rand(1,50),rand(1,70),false);
bar = py.scipy.stats.anderson_ksamp(rand(1,50),rand(1,70),'false');
bar = py.scipy.stats.anderson_ksamp(rand(1,50),rand(1,70),'midrank=false');
"Python Error: TypeError: anderson_ksamp() takes from 1 to 2 positional arguments but 3 were given"
I've read https://docs.scipy.org/doc/scipy/reference/stats.html as well as older questions about calling Python from Matlab, but the older questions do not apply to the current API.
Question 1: How do I call anderson_ksamp in MATLAB?
Question 2: How do I change the significance level of this test?
  댓글 수: 1
Eric
Eric 2017년 10월 12일
Note: I'm using a newly installed Python 3.6 along with the Numpy and Scipy libraries (I am calling the correct version within my code).

댓글을 달려면 로그인하십시오.

채택된 답변

Eric
Eric 2017년 10월 23일
Answer provided at https://stackoverflow.com/questions/46692482/call-python-from-matlab-2017-with-options/46813488#46813488

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by