{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "ac7f157f", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from scipy.spatial import distance\n", "# df1 = pd.read_csv('case1 class and location id80.csv')\n", "# df2 = pd.read_csv('case2 cell class and location ID90.csv')" ] }, { "cell_type": "code", "execution_count": 71, "id": "2d82b428", "metadata": {}, "outputs": [], "source": [ "\n", "\n", "def calculate_euclidean(data1, data2):\n", " \"\"\" Calculate pairwise Euclidean distance between two sets of points. \"\"\"\n", " return distance.cdist(data1[['X', 'Y']], data2[['X', 'Y']], 'euclidean')\n", "\n", "def average_distances(df):\n", " # Define masks for each category\n", " cd20_mask = df['Class'] == 'CD20'\n", " cfse_mask = df['Class'] == 'CFSE'\n", " other_mask = df['Class'] == 'Other'\n", " \n", " # Calculate average distance between each cell and all cells\n", "# df['avg_dist_to_all'] = df.apply(lambda row: np.mean(calculate_euclidean(df.loc[[row.name], ['X', 'Y']]), df[['X', 'Y']]), axis=1)\n", " df['avg_dist_to_all'] = df.apply(lambda row: np.mean(calculate_euclidean(df.loc[[row.name], ['X', 'Y']], df[['X', 'Y']])),axis=1)\n", " # Calculate average distance between each CD20 and CFSE cells\n", " if not df[cd20_mask].empty and not df[cfse_mask].empty:\n", " cd20_cfse_dist = calculate_euclidean(df.loc[cd20_mask, ['X', 'Y']], df.loc[cfse_mask, ['X', 'Y']])\n", " \n", " distance_df_cd20_cfse = pd.DataFrame(\n", " cd20_cfse_dist,\n", " index=['CD20_' + str(idx+1) for idx in df[cd20_mask].index], # Use CD20 indices for rows\n", " columns=['CFSE_' + str(idx+1) for idx in df[cfse_mask].index]) # Use CFSE indices for columns\n", " #index=df[cd20_mask].index, # Use CD20 indices for rows\n", " #columns=df[cfse_mask].index) # Use CFSE indices for columns\n", " \n", " avg_cd20_cfse = np.mean(cd20_cfse_dist)\n", " df.loc[cd20_mask, 'avg_dist_CD20_CFSE'] = avg_cd20_cfse\n", " df.loc[cfse_mask, 'avg_dist_CD20_CFSE'] = avg_cd20_cfse\n", "\n", " # Calculate average distance between each CFSE and other cells\n", " if not df[cfse_mask].empty and not df[other_mask].empty:\n", " cfse_other_dist = calculate_euclidean(df.loc[cfse_mask, ['X', 'Y']], df.loc[other_mask, ['X', 'Y']])\n", " \n", " distance_df_cfse_other = pd.DataFrame(\n", " cfse_other_dist,\n", " index=['CFSE_' + str(idx+1) for idx in df[cfse_mask].index], # Use CD20 indices for rows\n", " columns=['Other_' + str(idx+1) for idx in df[other_mask].index]) # Use CFSE indices for columns\n", "# index=df[cfse_mask].index, # Use CD20 indices for rows\n", "# columns=df[other_mask].index) # Use CFSE indices for columns\n", " \n", " avg_cfse_other = np.mean(cfse_other_dist)\n", " df.loc[cfse_mask, 'avg_dist_CFSE_other'] = avg_cfse_other\n", " df.loc[other_mask, 'avg_dist_CFSE_other'] = avg_cfse_other\n", "\n", " return df,cd20_cfse_dist,cfse_other_dist,distance_df_cd20_cfse,distance_df_cfse_other\n" ] }, { "cell_type": "code", "execution_count": 23, "id": "57e370d9", "metadata": {}, "outputs": [], "source": [ "if df1['X'].dtype != 'int':\n", " print('yes it is not')\n", " df1['X'] = df1['X'].astype(int)" ] }, { "cell_type": "code", "execution_count": 76, "id": "5e653264", "metadata": {}, "outputs": [], "source": [ "dff1,cd20_dist,cfse_dist,cd20,cfse=average_distances(df2)" ] }, { "cell_type": "code", "execution_count": 79, "id": "efe5abb1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ClassXYImageNameParentROINucleus: AreaNucleus: PerimeterNucleus: Circularity...Cytoplasm: IFNG minCytoplasm: CD38 meanCytoplasm: CD38 std devCytoplasm: CD38 maxCytoplasm: CD38 minNucleus/Cell area ratioavg_dist_to_allavg_dist_CD20_CFSEavg_dist_CFSE_othertry
0CD20883.908crop r1 6 color.tif (1)CD20PathAnnotationObjectPolygon9841.19370.7257...0344.7448517.1355246500.3377638.327917482.773143NaN[[0.0, 660.0, 372.0658543860213, 162.373027316...
1CD20963.236crop r1 6 color.tif (1)CD20PathAnnotationObjectPolygon18274.12370.4163...058.4732144.4971118900.4687671.780571482.773143NaN[[660.0, 0.0, 288.0850568842473, 822.073597678...
2CD20913.3111crop r1 6 color.tif (1)CD20PathAnnotationObjectPolygon21068.29520.5658...0120.8731152.570184000.4419647.274871482.773143NaN[[372.0658543860213, 288.0850568842473, 0.0, 5...
3CD20199.9211crop r1 6 color.tif (1)CD20PathAnnotationObjectPolygon18171.62510.4434...033.103396.969469700.3749684.015713482.773143NaN[[162.3730273167314, 822.073597678456, 534.014...
4CD20238.157crop r1 6 color.tif (1)CD20PathAnnotationObjectPolygon10340.81920.7768...037.2159144.8785129400.3739667.777435482.773143NaN[[658.1709504376504, 15.132745950421556, 286.1...
..................................................................
1148Other882.10891crop r1 6 color.tif (1)OtherPathAnnotationObjectPolygon11153.68740.4839...0209.5943767.8748552500.3084623.928819NaN601.552187[[684.0007309937614, 692.6304931202495, 599.17...
1149Other93.93894crop r1 6 color.tif (1)OtherPathAnnotationObjectPolygon12141.87180.8673...058.2703130.368889600.5214733.406021NaN601.552187[[795.2741665614444, 623.1059299990652, 615.83...
1150Other304.91894crop r1 6 color.tif (1)OtherPathAnnotationObjectPolygon12348.27810.6632...011.238774.142187600.4406628.322543NaN601.552187[[929.0048439055632, 606.6712454039667, 684.46...
1151Other589.09895crop r1 6 color.tif (1)OtherPathAnnotationObjectPolygon8634.34350.9163...0292.8750515.6979257000.4396574.887254NaN601.552187[[649.8253611548259, 742.7200010771219, 616.11...
1152Other233.55895crop r1 6 color.tif (1)OtherPathAnnotationObjectPolygon8849.35790.4539...028.1875115.991084900.3817658.199726NaN601.552187[[1023.8657138511867, 627.3603430246449, 750.8...
\n", "

1153 rows × 108 columns

\n", "
" ], "text/plain": [ " Class X Y Image Name \\\n", "0 CD20 883.90 8 crop r1 6 color.tif (1) CD20 \n", "1 CD20 963.23 6 crop r1 6 color.tif (1) CD20 \n", "2 CD20 913.31 11 crop r1 6 color.tif (1) CD20 \n", "3 CD20 199.92 11 crop r1 6 color.tif (1) CD20 \n", "4 CD20 238.15 7 crop r1 6 color.tif (1) CD20 \n", "... ... ... ... ... ... \n", "1148 Other 882.10 891 crop r1 6 color.tif (1) Other \n", "1149 Other 93.93 894 crop r1 6 color.tif (1) Other \n", "1150 Other 304.91 894 crop r1 6 color.tif (1) Other \n", "1151 Other 589.09 895 crop r1 6 color.tif (1) Other \n", "1152 Other 233.55 895 crop r1 6 color.tif (1) Other \n", "\n", " Parent ROI Nucleus: Area Nucleus: Perimeter \\\n", "0 PathAnnotationObject Polygon 98 41.1937 \n", "1 PathAnnotationObject Polygon 182 74.1237 \n", "2 PathAnnotationObject Polygon 210 68.2952 \n", "3 PathAnnotationObject Polygon 181 71.6251 \n", "4 PathAnnotationObject Polygon 103 40.8192 \n", "... ... ... ... ... \n", "1148 PathAnnotationObject Polygon 111 53.6874 \n", "1149 PathAnnotationObject Polygon 121 41.8718 \n", "1150 PathAnnotationObject Polygon 123 48.2781 \n", "1151 PathAnnotationObject Polygon 86 34.3435 \n", "1152 PathAnnotationObject Polygon 88 49.3579 \n", "\n", " Nucleus: Circularity ... Cytoplasm: IFNG min Cytoplasm: CD38 mean \\\n", "0 0.7257 ... 0 344.7448 \n", "1 0.4163 ... 0 58.4732 \n", "2 0.5658 ... 0 120.8731 \n", "3 0.4434 ... 0 33.1033 \n", "4 0.7768 ... 0 37.2159 \n", "... ... ... ... ... \n", "1148 0.4839 ... 0 209.5943 \n", "1149 0.8673 ... 0 58.2703 \n", "1150 0.6632 ... 0 11.2387 \n", "1151 0.9163 ... 0 292.8750 \n", "1152 0.4539 ... 0 28.1875 \n", "\n", " Cytoplasm: CD38 std dev Cytoplasm: CD38 max Cytoplasm: CD38 min \\\n", "0 517.1355 2465 0 \n", "1 144.4971 1189 0 \n", "2 152.5701 840 0 \n", "3 96.9694 697 0 \n", "4 144.8785 1294 0 \n", "... ... ... ... \n", "1148 767.8748 5525 0 \n", "1149 130.3688 896 0 \n", "1150 74.1421 876 0 \n", "1151 515.6979 2570 0 \n", "1152 115.9910 849 0 \n", "\n", " Nucleus/Cell area ratio avg_dist_to_all avg_dist_CD20_CFSE \\\n", "0 0.3377 638.327917 482.773143 \n", "1 0.4687 671.780571 482.773143 \n", "2 0.4419 647.274871 482.773143 \n", "3 0.3749 684.015713 482.773143 \n", "4 0.3739 667.777435 482.773143 \n", "... ... ... ... \n", "1148 0.3084 623.928819 NaN \n", "1149 0.5214 733.406021 NaN \n", "1150 0.4406 628.322543 NaN \n", "1151 0.4396 574.887254 NaN \n", "1152 0.3817 658.199726 NaN \n", "\n", " avg_dist_CFSE_other try \n", "0 NaN [[0.0, 660.0, 372.0658543860213, 162.373027316... \n", "1 NaN [[660.0, 0.0, 288.0850568842473, 822.073597678... \n", "2 NaN [[372.0658543860213, 288.0850568842473, 0.0, 5... \n", "3 NaN [[162.3730273167314, 822.073597678456, 534.014... \n", "4 NaN [[658.1709504376504, 15.132745950421556, 286.1... \n", "... ... ... \n", "1148 601.552187 [[684.0007309937614, 692.6304931202495, 599.17... \n", "1149 601.552187 [[795.2741665614444, 623.1059299990652, 615.83... \n", "1150 601.552187 [[929.0048439055632, 606.6712454039667, 684.46... \n", "1151 601.552187 [[649.8253611548259, 742.7200010771219, 616.11... \n", "1152 601.552187 [[1023.8657138511867, 627.3603430246449, 750.8... \n", "\n", "[1153 rows x 108 columns]" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dff1" ] }, { "cell_type": "code", "execution_count": 80, "id": "7ffef898", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CFSE_244CFSE_245CFSE_246CFSE_247CFSE_248CFSE_249CFSE_250CFSE_251CFSE_252CFSE_253...CFSE_258CFSE_259CFSE_260CFSE_261CFSE_262CFSE_263CFSE_264CFSE_265CFSE_266CFSE_267
CD20_1535.985894821.854173936.9095491127.826137424.119658518.104478669.211897244.677044263.922474661.057129...558.850329728.476967834.4362891020.627534897.261583909.3853771045.867468847.269162910.1297011228.204453
CD20_2614.836850899.7208561010.5894241184.453781502.745755596.947861745.893569239.716479258.444428735.366679...528.326680780.792033894.1365201087.164485956.533187969.1500471110.880797889.148875946.4583661286.111312
CD20_3564.692745849.876111962.6367391145.805747452.645380546.804762696.513600236.097353255.378059687.066297...543.004578744.422488853.6458141042.957811916.309632928.6543071067.510804858.937945919.5865591246.759772
CD20_4171.022484216.962906416.731262829.933795275.240106186.371646200.064422780.684407789.779960268.058650...1065.192602623.304539587.622090609.563264630.758737631.812917652.093736796.418800890.336323894.646505
CD20_5139.908259242.746469437.335672838.478815239.670110153.897896199.106127745.567592755.016294263.747457...1033.327007613.343761587.110780623.609052633.061723635.030169665.432554787.391621881.129077906.657708
..................................................................
CD20_239813.506783699.058015520.41767589.639661847.358912819.101178679.776281984.670853975.046897621.248047...1023.610334385.764567306.255649314.342158249.365400244.725185275.058467316.063809326.681130167.474655
CD20_240806.177943709.944130539.733087135.833666833.511385810.713275679.001956947.314343937.104178617.721155...977.111133356.547743295.939845340.948760245.001029243.421573304.751236271.014465276.592901218.176671
CD20_241827.328355700.047519515.57782765.998855865.494255833.633840689.3989641016.9013071007.595857633.015842...1060.208449414.636082324.862159305.224724265.185600258.639704263.772174352.422036364.147416130.403834
CD20_242808.089995721.218346555.272316162.118179831.863460812.054826684.563491931.664556921.082209622.011005...955.138172347.376234298.401275360.267641251.290041251.278753325.442146251.047716251.709094244.282047
CD20_243877.414513702.921285502.383421123.419935931.711860886.369565726.2186031137.9957441130.083109679.600918...1201.381675529.391055410.188524293.535926347.189746335.576273250.396082494.500072512.82624819.332341
\n", "

243 rows × 24 columns

\n", "
" ], "text/plain": [ " CFSE_244 CFSE_245 CFSE_246 CFSE_247 CFSE_248 \\\n", "CD20_1 535.985894 821.854173 936.909549 1127.826137 424.119658 \n", "CD20_2 614.836850 899.720856 1010.589424 1184.453781 502.745755 \n", "CD20_3 564.692745 849.876111 962.636739 1145.805747 452.645380 \n", "CD20_4 171.022484 216.962906 416.731262 829.933795 275.240106 \n", "CD20_5 139.908259 242.746469 437.335672 838.478815 239.670110 \n", "... ... ... ... ... ... \n", "CD20_239 813.506783 699.058015 520.417675 89.639661 847.358912 \n", "CD20_240 806.177943 709.944130 539.733087 135.833666 833.511385 \n", "CD20_241 827.328355 700.047519 515.577827 65.998855 865.494255 \n", "CD20_242 808.089995 721.218346 555.272316 162.118179 831.863460 \n", "CD20_243 877.414513 702.921285 502.383421 123.419935 931.711860 \n", "\n", " CFSE_249 CFSE_250 CFSE_251 CFSE_252 CFSE_253 ... \\\n", "CD20_1 518.104478 669.211897 244.677044 263.922474 661.057129 ... \n", "CD20_2 596.947861 745.893569 239.716479 258.444428 735.366679 ... \n", "CD20_3 546.804762 696.513600 236.097353 255.378059 687.066297 ... \n", "CD20_4 186.371646 200.064422 780.684407 789.779960 268.058650 ... \n", "CD20_5 153.897896 199.106127 745.567592 755.016294 263.747457 ... \n", "... ... ... ... ... ... ... \n", "CD20_239 819.101178 679.776281 984.670853 975.046897 621.248047 ... \n", "CD20_240 810.713275 679.001956 947.314343 937.104178 617.721155 ... \n", "CD20_241 833.633840 689.398964 1016.901307 1007.595857 633.015842 ... \n", "CD20_242 812.054826 684.563491 931.664556 921.082209 622.011005 ... \n", "CD20_243 886.369565 726.218603 1137.995744 1130.083109 679.600918 ... \n", "\n", " CFSE_258 CFSE_259 CFSE_260 CFSE_261 CFSE_262 \\\n", "CD20_1 558.850329 728.476967 834.436289 1020.627534 897.261583 \n", "CD20_2 528.326680 780.792033 894.136520 1087.164485 956.533187 \n", "CD20_3 543.004578 744.422488 853.645814 1042.957811 916.309632 \n", "CD20_4 1065.192602 623.304539 587.622090 609.563264 630.758737 \n", "CD20_5 1033.327007 613.343761 587.110780 623.609052 633.061723 \n", "... ... ... ... ... ... \n", "CD20_239 1023.610334 385.764567 306.255649 314.342158 249.365400 \n", "CD20_240 977.111133 356.547743 295.939845 340.948760 245.001029 \n", "CD20_241 1060.208449 414.636082 324.862159 305.224724 265.185600 \n", "CD20_242 955.138172 347.376234 298.401275 360.267641 251.290041 \n", "CD20_243 1201.381675 529.391055 410.188524 293.535926 347.189746 \n", "\n", " CFSE_263 CFSE_264 CFSE_265 CFSE_266 CFSE_267 \n", "CD20_1 909.385377 1045.867468 847.269162 910.129701 1228.204453 \n", "CD20_2 969.150047 1110.880797 889.148875 946.458366 1286.111312 \n", "CD20_3 928.654307 1067.510804 858.937945 919.586559 1246.759772 \n", "CD20_4 631.812917 652.093736 796.418800 890.336323 894.646505 \n", "CD20_5 635.030169 665.432554 787.391621 881.129077 906.657708 \n", "... ... ... ... ... ... \n", "CD20_239 244.725185 275.058467 316.063809 326.681130 167.474655 \n", "CD20_240 243.421573 304.751236 271.014465 276.592901 218.176671 \n", "CD20_241 258.639704 263.772174 352.422036 364.147416 130.403834 \n", "CD20_242 251.278753 325.442146 251.047716 251.709094 244.282047 \n", "CD20_243 335.576273 250.396082 494.500072 512.826248 19.332341 \n", "\n", "[243 rows x 24 columns]" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cd20" ] }, { "cell_type": "code", "execution_count": 78, "id": "b77b2f5b", "metadata": {}, "outputs": [], "source": [ "dff1['try'] = df1.apply(lambda row: calculate_euclidean(df1.loc[[row.name], ['X', 'Y']], df1[['X', 'Y']]),axis=1)\n" ] }, { "cell_type": "code", "execution_count": 60, "id": "568a60be", "metadata": {}, "outputs": [], "source": [ "#dff1=dff1.drop('try',axis=1)" ] }, { "cell_type": "code", "execution_count": 81, "id": "23651e95", "metadata": {}, "outputs": [], "source": [ "# Save the DataFrame to a CSV file\n", "dff1.to_csv('case2 cell class and location ID90.csv',index=False)\n", "cd20.to_csv('distances_CD20_CFSE_case2_ID90.csv')\n", "cfse.to_csv('distances_CFSE_other_case2_ID90.csv')\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }