MIMIC-III_ICU_Readmission_Analysis icon indicating copy to clipboard operation
MIMIC-III_ICU_Readmission_Analysis copied to clipboard

raise KeyError(f"{not_found} not in index")

Open CalendulaED opened this issue 3 years ago • 1 comments

When I tried to run python3 scripts/extract_sub jects.py /home/edmundwuyuxuan/MIMIC3Data/FullMIMIC/physionet.org/files/mimiciii/1.4 data/root/

it shows: Traceback (most recent call last): File "scripts/extract_subjects.py", line 92, in <module> make_phenotype_label_matrix(phenotypes, stays).to_csv(os.path.join(args.output_path, 'phenotype_labels.csv'), File "/home/edmundwuyuxuan/existing/MIMIC-III_ICU_Readmission_Analysis/mimic3-readmission/mimic3benchmark/preprocessing.py", line 75, in make_phenotype_label_matrix phenotypes = phenotypes.loc[stays.ICUSTAY_ID.sort_values()] File "/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py", line 931, in __getitem__ return self._getitem_axis(maybe_callable, axis=axis) File "/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py", line 1153, in _getitem_axis return self._getitem_iterable(key, axis=axis) File "/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py", line 1093, in _getitem_iterable keyarr, indexer = self._get_listlike_indexer(key, axis) File "/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py", line 1314, in _get_listlike_indexer self._validate_read_indexer(keyarr, indexer, axis) File "/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py", line 1377, in _validate_read_indexer raise KeyError(f"{not_found} not in index") KeyError: '[20390, 280394, 280464, 280479, 280483, 280487, 280488, 280496, 280502, 280565, 280624, 280646, 280666, 280670, 280698, 280716, 280728, 280745, 280810, 280821, 280827, 280835, 280851, 280880, 280893, 280899, 280975, 280986, 281044, 281085, 281092, 281111, 281135, 281155, 281246, 281271, 281341, 281347, 281368, 281402, 281441, 281452, 281520, 281537, 281543, 281554, 281564, 281585, 281589, 281610, 281631, 281634, 281662, 281666, 281675, 281761, 281783, 281802, 281814, 281832, 281835, 281847, 281901, 281934, 282011, 282041, 282111, 282186, 282210, 282220, 282300, 282314, 282335, 282337, 282383, 282399, 282424, 282472, 282510, 282524, 282532, 282559, 282611, 282666, 282854, 282948, 282955, 282958, 282959, 282968, 283023, 283129, 283196, 283197, 283208, 283218, 283233, 283274, 283275, 283308, 283367, 283427, 283430, 283457, 283486, 283504, 283506, 283527, 283530, 283628, 283635, 283676, 283729, 283738, 283744, 283796, 283807, 283823, 283861, 283896, 283905, 283945, 283978, 284010, 284054, 284062, 284132, 284138, 284161, 284179, 284199, 284367, 284475, 284550, 284564, 284617, 284621, 284631, 284651, 284660, 284664, 284671, 284706, 284752, 284770, 284796, 284807, 284844, 284852, 284879, 284953, 284967, 284993, 285053, 285224, 285291, 285308, 285337, 285347, 285384, 285407, 285465, 285475, 285497, 285530, 285693, 285737, 285909, 285914, 286004, 286013, 286063, 286069, 286075, 286090, 286120, 286137, 286186, 286274, 286358, 286366, 286397, 286413, 286414, 286441, 286484, 286505, 286544, 286549, 286567, 286600, 286683, 286708, 286722, 286735, 286748, 286788, 286857, 286910, 286928, 286975, 286994, 287023, 287117, 287207, 287231, 287242, 287247, 287269, 287305, 287416, 287509, 287553, 287592, 287597, 287618, 287648, 287661, 287675, 287687, 287751, 287825, 287877, 287904, 287928, 287944, 287952, 287958, 288094, 288114, 288157, 288210, 288227, 288234, 288242, 288285, 288308, 288325, 288364, 288383, 288390, 288443, 288472, 288474, 288478, 288488, 288489, 288502, 288512, 288607, 288623, 288651, 288672, 288712, 288832, 288863, 288876, 288882, 288898, 288901, 288922, 289062, 289086, 289155, 289246, 289318, 289351, 289358, 289398, 289416, 289422, 289451, 289465, 289469, 289474, 289501, 289515, 289517, 289528, 289533, 289541, 289566, 289567, 289619, 289674, 289697, 289712, 289721, 289744, 289756, 289859, 289875, 290086, 290096, 290100, 290143, 290160, 290274, 290295, 290332, 290352, 290368, 290401, 290462, 290506, 290517, 290546, 290548, 290583, 290596, 290662, 290716, 290736, 290802, 290896, 290953, 291008, 291009, 291022, 291029, 291090, 291106, 291112, 291142, 291217, 291307, 291308, 291310, 291330, 291388, 291415, 291419, 291527, 291551, 291566, 291723, 291735, 291749, 291777, 291791, 291794, 291807, 291812, 291816, 291931, 291935, 291991, 291993, 292032, 292039, 292045, 292077, 292111, 292148, 292362, 292397, 292436, 292445, 292460, 292467, 292486, 292531, 292558, 292562, 292625, 292657, 292708, 292784, 292818, 292889, 292918, 292923, 292926, 292962, 293080, 293090, 293105, 293174, 293191, 293194, 293216, 293280, 293316, 293356, 293362, 293381, 293394, 293476, 293540, 293552, 293593, 293597, 293615, 293704, 293731, 293737, 293769, 293776, 293790, 293870, 293886, 293933, 293953, 293990, 294086, 294099, 294130, 294176, 294201, 294240, 294333, 294341, 294370, 294388, 294393, 294405, 294440, 294443, 294472, 294473, 294497, 294541, 294564, 294569, 294574, 294596, 294730, 294816, 294834, 294852, 294934, 294946, 294969, 294991, 295012, 295030, 295065, 295093, 295138, 295168, 295182, 295220, 295254, 295278, 295325, 295343, 295376, 295393, 295402, 295416, 295502, 295517, 295525, 295551, 295607, 295708, 295741, 295747, 295761, 295797, 295806, 295810, 295847, 295893, 296016, 296033, 296047, 296096, 296098, 296111, 296137, 296149, 296154, 296157, 296171, 296180, 296197, 296248, 296273, 296289, 296297, 296362, 296378, 296381, 296386, 296411, 296414, 296424, 296428, 296452, 296485, 296496, 296510, 296533, 296581, 296774, 296808, 296814, 296839, 296846, 296852, 296859, 296878, 296900, 296943, 296947, 296958, 296959, 297040, 297067, 297088, 297137, 297142, 297191, 297396, 297441, 297443, 297458, 297509, 297562, 297567, 297574, 297624, 297665, 297703, 297777, 297856, 297916, 297917, 297920, 297951, 298061, 298156, 298161, 298222, 298259, 298264, 298390, 298435, 298497, 298498, 298512, 298624, 298718, 298725, 298734, 298761, 298790, 298856, 298871, 298873, 299003, 299030, 299072, 299090, 299137, 299171, 299202, 299216, 299229, 299238, 299246, 299247, 299338, 299375, 299394, 299408, 299419, 299448, 299469, 299523, 299528, 299609, 299681, 299685, 299760, 299772, 299776, 299788, 299852, 299886, 299921, 299949, 299962, 299993] not in index'

not sure how this happens, any help is appreciated!

CalendulaED avatar Jul 25 '21 03:07 CalendulaED

Same issue. Have you fixed it? Thanks.

daiyl avatar Mar 28 '24 09:03 daiyl