{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":87793,"databundleVersionId":12024591,"sourceType":"competition"},{"sourceId":11529207,"sourceType":"datasetVersion","datasetId":7060141}],"dockerImageVersionId":30918,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!cp /kaggle/input/stanford-rna-3d-folding/sample_submission.csv /kaggle/working/data.csv","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:49:53.668434Z","iopub.execute_input":"2025-04-28T10:49:53.668890Z","iopub.status.idle":"2025-04-28T10:49:53.798328Z","shell.execute_reply.started":"2025-04-28T10:49:53.668851Z","shell.execute_reply":"2025-04-28T10:49:53.796989Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!cp /kaggle/input/manual-submission/submission.csv /kaggle/working/test.csv","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:49:53.799920Z","iopub.execute_input":"2025-04-28T10:49:53.800204Z","iopub.status.idle":"2025-04-28T10:49:53.933103Z","shell.execute_reply.started":"2025-04-28T10:49:53.800179Z","shell.execute_reply":"2025-04-28T10:49:53.931824Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import pandas as pd\n\n# Load CSV into a DataFrame\ndf = pd.read_csv('/kaggle/working/data.csv')\n\n# Show the first 5 rows\nprint(df.head())\nprint(len(df))\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:49:53.935473Z","iopub.execute_input":"2025-04-28T10:49:53.935815Z","iopub.status.idle":"2025-04-28T10:49:54.349678Z","shell.execute_reply.started":"2025-04-28T10:49:53.935786Z","shell.execute_reply":"2025-04-28T10:49:54.348577Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Load CSV into a DataFrame\ndf2 = pd.read_csv('/kaggle/working/test.csv')\n\n# Show the first 5 rows\nprint(df2.head())\nprint(len(df2))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:49:54.351447Z","iopub.execute_input":"2025-04-28T10:49:54.351843Z","iopub.status.idle":"2025-04-28T10:49:54.379623Z","shell.execute_reply.started":"2025-04-28T10:49:54.351808Z","shell.execute_reply":"2025-04-28T10:49:54.378401Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"num = 2515\n# Get the first 500 rows of df\nfirst_num_ids = df.iloc[:num]['ID']\n\n# Find matching rows in df2\ndf2_matches = df2[df2['ID'].isin(first_num_ids)]\n\n# Replace rows in df where ID matches, only within the first 500 rows\nfor i in df.index[:num]:\n    row_id = df.at[i, 'ID']\n    match = df2[df2['ID'] == row_id]\n    if not match.empty:\n        df.loc[i] = match.iloc[0]\n    else:\n        print(row_id)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:49:54.380895Z","iopub.execute_input":"2025-04-28T10:49:54.381273Z","iopub.status.idle":"2025-04-28T10:50:02.544955Z","shell.execute_reply.started":"2025-04-28T10:49:54.381239Z","shell.execute_reply":"2025-04-28T10:50:02.544033Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df.head())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:50:02.545950Z","iopub.execute_input":"2025-04-28T10:50:02.546205Z","iopub.status.idle":"2025-04-28T10:50:02.557433Z","shell.execute_reply.started":"2025-04-28T10:50:02.546185Z","shell.execute_reply":"2025-04-28T10:50:02.556447Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.to_csv('/kaggle/working/submission.csv', index=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:50:02.558295Z","iopub.execute_input":"2025-04-28T10:50:02.558563Z","iopub.status.idle":"2025-04-28T10:50:02.629014Z","shell.execute_reply.started":"2025-04-28T10:50:02.558541Z","shell.execute_reply":"2025-04-28T10:50:02.628059Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!rm /kaggle/working/data.csv","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:50:02.629847Z","iopub.execute_input":"2025-04-28T10:50:02.630093Z","iopub.status.idle":"2025-04-28T10:50:02.750306Z","shell.execute_reply.started":"2025-04-28T10:50:02.630072Z","shell.execute_reply":"2025-04-28T10:50:02.749233Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!rm /kaggle/working/test.csv","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-28T10:50:02.752617Z","iopub.execute_input":"2025-04-28T10:50:02.752912Z","iopub.status.idle":"2025-04-28T10:50:02.873269Z","shell.execute_reply.started":"2025-04-28T10:50:02.752888Z","shell.execute_reply":"2025-04-28T10:50:02.872010Z"}},"outputs":[],"execution_count":null}]}