You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I run the commands with my data like your template. However, I have faced with this errors. Could you please help me to solve my problem?
KeyError Traceback (most recent call last)
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\indexes\base.py:3803, in Index.get_loc(self, key, method, tolerance)
3802 try:
-> 3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
File ~\anaconda3\envs\torch\lib\site-packages\pandas_libs\index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~\anaconda3\envs\torch\lib\site-packages\pandas_libs\index.pyx:165, in pandas._libs.index.IndexEngine.get_loc()
File pandas_libs\hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas_libs\hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'fdr_bh adj. p-value'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In [28], line 1
----> 1 plot_enrichment_analysis_results(results, "fdr_bh")
Cell In [27], line 2, in plot_enrichment_analysis_results(results, adj_method)
1 def plot_enrichment_analysis_results(results: pd.DataFrame, adj_method:str):
----> 2 fold_enrichment = np.abs(np.log(results["%s adj. p-value" % (adj_method)]))
3 plt.figure()
4 plt.title("Metabolite Sets Enrichment Overview")
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\frame.py:3804, in DataFrame.getitem(self, key)
3802 if self.columns.nlevels > 1:
3803 return self._getitem_multilevel(key)
-> 3804 indexer = self.columns.get_loc(key)
3805 if is_integer(indexer):
3806 indexer = [indexer]
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\indexes\base.py:3805, in Index.get_loc(self, key, method, tolerance)
3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
-> 3805 raise KeyError(key) from err
3806 except TypeError:
3807 # If we have a listlike key, _check_indexing_error will raise
3808 # InvalidIndexError. Otherwise we fall through and re-raise
3809 # the TypeError.
3810 self._check_indexing_error(key)
KeyError: 'fdr_bh adj. p-value'
The text was updated successfully, but these errors were encountered:
Hello,
I run the commands with my data like your template. However, I have faced with this errors. Could you please help me to solve my problem?
KeyError Traceback (most recent call last)
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\indexes\base.py:3803, in Index.get_loc(self, key, method, tolerance)
3802 try:
-> 3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
File ~\anaconda3\envs\torch\lib\site-packages\pandas_libs\index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~\anaconda3\envs\torch\lib\site-packages\pandas_libs\index.pyx:165, in pandas._libs.index.IndexEngine.get_loc()
File pandas_libs\hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas_libs\hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'fdr_bh adj. p-value'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In [28], line 1
----> 1 plot_enrichment_analysis_results(results, "fdr_bh")
Cell In [27], line 2, in plot_enrichment_analysis_results(results, adj_method)
1 def plot_enrichment_analysis_results(results: pd.DataFrame, adj_method:str):
----> 2 fold_enrichment = np.abs(np.log(results["%s adj. p-value" % (adj_method)]))
3 plt.figure()
4 plt.title("Metabolite Sets Enrichment Overview")
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\frame.py:3804, in DataFrame.getitem(self, key)
3802 if self.columns.nlevels > 1:
3803 return self._getitem_multilevel(key)
-> 3804 indexer = self.columns.get_loc(key)
3805 if is_integer(indexer):
3806 indexer = [indexer]
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\indexes\base.py:3805, in Index.get_loc(self, key, method, tolerance)
3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
-> 3805 raise KeyError(key) from err
3806 except TypeError:
3807 # If we have a listlike key, _check_indexing_error will raise
3808 # InvalidIndexError. Otherwise we fall through and re-raise
3809 # the TypeError.
3810 self._check_indexing_error(key)
KeyError: 'fdr_bh adj. p-value'
The text was updated successfully, but these errors were encountered: