{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.11","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":91249,"databundleVersionId":11294684,"sourceType":"competition"}],"dockerImageVersionId":31012,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\n\n# Load the training labels\ntrain_labels = pd.read_csv('/kaggle/input/byu-locating-bacterial-flagellar-motors-2025/train_labels.csv')\n\n# Count unique tomograms\nunique_tomograms = train_labels['tomo_id'].nunique()\n\n# Motors per tomogram\nmotors_per_tomo = train_labels.groupby('tomo_id')['Number of motors'].first()\nmotors_per_tomo.describe()","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-04-27T13:21:20.159353Z","iopub.execute_input":"2025-04-27T13:21:20.159666Z","iopub.status.idle":"2025-04-27T13:21:22.335217Z","shell.execute_reply.started":"2025-04-27T13:21:20.159637Z","shell.execute_reply":"2025-04-27T13:21:22.334100Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import matplotlib.pyplot as plt\n\n# Plot histograms for motor coordinates\nfig, axes = plt.subplots(1, 3, figsize=(15, 5))\n\naxes[0].hist(train_labels['Motor axis 0'], bins=50, color='blue', alpha=0.7)\naxes[0].set_title('Distribution of Z-coordinates')\naxes[0].set_xlabel('Z-coordinate')\naxes[0].set_ylabel('Frequency')\n\naxes[1].hist(train_labels['Motor axis 1'], bins=50, color='green', alpha=0.7)\naxes[1].set_title('Distribution of Y-coordinates')\naxes[1].set_xlabel('Y-coordinate')\n\naxes[2].hist(train_labels['Motor axis 2'], bins=50, color='red', alpha=0.7)\naxes[2].set_title('Distribution of X-coordinates')\naxes[2].set_xlabel('X-coordinate')\n\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-27T13:21:31.793985Z","iopub.execute_input":"2025-04-27T13:21:31.794888Z","iopub.status.idle":"2025-04-27T13:21:32.627483Z","shell.execute_reply.started":"2025-04-27T13:21:31.794849Z","shell.execute_reply":"2025-04-27T13:21:32.626494Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Plot histogram of voxel spacing\nplt.hist(train_labels['Voxel spacing'], bins=50, color='purple', alpha=0.7)\nplt.title('Distribution of Voxel Spacing')\nplt.xlabel('Voxel Spacing (angstroms per voxel)')\nplt.ylabel('Frequency')\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-27T13:21:50.751549Z","iopub.execute_input":"2025-04-27T13:21:50.751875Z","iopub.status.idle":"2025-04-27T13:21:50.987179Z","shell.execute_reply.started":"2025-04-27T13:21:50.751850Z","shell.execute_reply":"2025-04-27T13:21:50.986321Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Plot histograms for tomogram dimensions\nfig, axes = plt.subplots(1, 3, figsize=(15, 5))\n\naxes[0].hist(train_labels['Array shape (axis 0)'], bins=50, color='orange', alpha=0.7)\naxes[0].set_title('Distribution of Z-axis Length')\naxes[0].set_xlabel('Z-axis Length')\n\naxes[1].hist(train_labels['Array shape (axis 1)'], bins=50, color='cyan', alpha=0.7)\naxes[1].set_title('Distribution of Y-axis Length')\naxes[1].set_xlabel('Y-axis Length')\n\naxes[2].hist(train_labels['Array shape (axis 2)'], bins=50, color='magenta', alpha=0.7)\naxes[2].set_title('Distribution of X-axis Length')\naxes[2].set_xlabel('X-axis Length')\n\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-27T13:24:26.826363Z","iopub.execute_input":"2025-04-27T13:24:26.826673Z","iopub.status.idle":"2025-04-27T13:24:27.512498Z","shell.execute_reply.started":"2025-04-27T13:24:26.826650Z","shell.execute_reply":"2025-04-27T13:24:27.511476Z"}},"outputs":[],"execution_count":null}]}