What is an equivalent of find() in python?

139 Ansichten (letzte 30 Tage)
Prb
Prb am 12 Jun. 2019
Bearbeitet: Walter Roberson am 16 Jun. 2022
Hi could you please explain what the find() doing in hte below code. How can I represent the similar code in python?
PercentCorrectTest = 100*(1-length(find(ClassificationID_test'~=double(labels_test)))/K_test)
  3 Kommentare
Rik
Rik am 12 Jun. 2019
Also, find is not the most intricate thing, there is an implicit expansion in that comparison. The combination of length and find can be replaced with sum.
Walter Roberson
Walter Roberson am 12 Jun. 2019
I suspect that in context you might be able to use (1-mean())*100 in the matlab.
The point of the code is to calculate a percentage match.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Raj
Raj am 12 Jun. 2019
Bearbeitet: Walter Roberson am 16 Jun. 2022

Weitere Antworten (0)

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by