The Python Oracle

Converting matlab program to equivalent python code

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Ominous Technology Looping

--

Chapters
00:00 Question
00:56 Accepted answer (Score 2)
01:10 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]