You need more that just change the input to a pandas DataFrame to convert a matlab script to a python one.
First of all, array indexing in matlab uses the (i, j...) syntax with indexes starting at 1 and python uses [i, j...] with first element 0.
The ismember operation in python is done using sets or list with the syntax "if x in {1, 2, 3}" but in matlab can have several uses and you must see really which is the intended selection.
My recommendation is that you read first the introduction to python and numpy or otherwise your task will be almost impossible...
Otherwise you might want to explore the Matlab to Python conversion using some of the tools of this StackOverflow question or this post or stick to matlab and use octave or scilab.
... and I think I abuse of the links a little bit.
First of all, array indexing in matlab uses the (i, j...) syntax with indexes starting at 1 and python uses [i, j...] with first element 0.
The ismember operation in python is done using sets or list with the syntax "if x in {1, 2, 3}" but in matlab can have several uses and you must see really which is the intended selection.
My recommendation is that you read first the introduction to python and numpy or otherwise your task will be almost impossible...
Otherwise you might want to explore the Matlab to Python conversion using some of the tools of this StackOverflow question or this post or stick to matlab and use octave or scilab.
... and I think I abuse of the links a little bit.