I have a dataframe, df, such that when I print it out, it looks like:
<code>dataframe after all drops looks like: ILSILS EUREUR
date
2024-05-06 1.0 1
</code>
<code>dataframe after all drops looks like: ILSILS EUREUR
date
2024-05-06 1.0 1
</code>
dataframe after all drops looks like: ILSILS EUREUR
date
2024-05-06 1.0 1
I am trying to remove the EUREUR
column (I think it is a column!)
When I try to run:
<code>df = df.drop('EUREUR', axis=1)
</code>
<code>df = df.drop('EUREUR', axis=1)
</code>
df = df.drop('EUREUR', axis=1)
I run into:
<code> File ~/.conda/envs/py311-latest/lib/python3.11/site-packages/pandas/core/indexes/base.py:3655, in Index.get_loc(self, key)
3653 return self._engine.get_loc(casted_key)
3654 except KeyError as err:
-> 3655 raise KeyError(key) from err
3656 except TypeError:
3657 # If we have a listlike key, _check_indexing_error will raise
3658 # InvalidIndexError. Otherwise we fall through and re-raise
3659 # the TypeError.
3660 self._check_indexing_error(key)
KeyError: 'EUREUR'
</code>
<code> File ~/.conda/envs/py311-latest/lib/python3.11/site-packages/pandas/core/indexes/base.py:3655, in Index.get_loc(self, key)
3653 return self._engine.get_loc(casted_key)
3654 except KeyError as err:
-> 3655 raise KeyError(key) from err
3656 except TypeError:
3657 # If we have a listlike key, _check_indexing_error will raise
3658 # InvalidIndexError. Otherwise we fall through and re-raise
3659 # the TypeError.
3660 self._check_indexing_error(key)
KeyError: 'EUREUR'
</code>
File ~/.conda/envs/py311-latest/lib/python3.11/site-packages/pandas/core/indexes/base.py:3655, in Index.get_loc(self, key)
3653 return self._engine.get_loc(casted_key)
3654 except KeyError as err:
-> 3655 raise KeyError(key) from err
3656 except TypeError:
3657 # If we have a listlike key, _check_indexing_error will raise
3658 # InvalidIndexError. Otherwise we fall through and re-raise
3659 # the TypeError.
3660 self._check_indexing_error(key)
KeyError: 'EUREUR'
1