Dropping missing rows in two dataframes
When you read the two csv files and store the data in two dataframes, you could then combine it into one dataframe, do the dropna and then split it back. I will give an example using pandas
import pandas as pd
df1 = pd.read_csv('test_data.csv')
df2 = pd.read_csv('submission_data.csv')
df3 = pd.concat([df1, df2], axis=1) # this will combine the two dfs.
reduced_data = df3.dropna(thresh=math.ceil(test_data.shape[1]/2))
predictions = reduced_data.loc[:,['predictions']]
reduced_data.drop(columns=['predictions'], inplace=True)
#instead of 'predictions', use whatever column name you have for the predictions in submission_data.csv file.
Hope this helps.