The Python Oracle

Converting matlab program to equivalent python code

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: The Builders

--

Chapters
00:00 Converting Matlab Program To Equivalent Python Code
00:43 Accepted Answer Score 2
00:51 Thank you

--

Full question
https://stackoverflow.com/questions/1189...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #numpy #scipy

#avk47



ACCEPTED ANSWER

Score 2


use a list comprehension to convert bool to int:

[int(val) for val in x]