I have a code:
import pandas as pd import numpy as np arm_1_and_m1_df = pd.DataFrame({ \'record_id\': [1, 4, 3, np.nan], \'two\': [1, 2, np.n
Try isin and slicing on index
isin
a_index = (redcap_final_arm1_data.index[redcap_final_arm1_data.record_id .isin(arm_1_and_m1_df.record_id)].tolist())
output:
Out[1355]: [0, 2, 3, 9]