Python equivalent to subset function in r : <p>I don't know python at all but the project I'm currently working on must be done using it, I have this r code </p>

<p><code>y_train &lt;- subset(train_df_cleaned_2, Id==IdExec)$Y</code> </p>

<p>and I need to do the exact same thing in python. How do I do it? Thank you </p>
