DataFrame的列索引是通过调用哪个类的哪个方法实现的?

import pandas as pd
df = pd.read_excel(r'C:\Users\Administrator\Desktop\时间安排.xlsx')
df = df['date']
.......


请问大神们
df['date'] 是一个列索引,他底层是怎么实现的?是调用DataFrame类里面的哪一个方法实现的?

应该是__getitem__方法。
我是去访问不存在的列索引 或者 访问行索引,看报错信息。

df = pd.DataFrame(
    data=[0,1,2,3],
    index=list('ABCD'),
    columns=['col']
)
df['E']
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   3080             try:
-> 3081                 return self._engine.get_loc(casted_key)
   3082             except KeyError as err:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'E'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
<ipython-input-61-da103df23740> in <module>
----> 1 df['E']

/usr/local/lib/python3.7/site-packages/pandas/core/frame.py in __getitem__(self, key)
   3022             if self.columns.nlevels > 1:
   3023                 return self._getitem_multilevel(key)
-> 3024             indexer = self.columns.get_loc(key)
   3025             if is_integer(indexer):
   3026                 indexer = [indexer]

/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   3081                 return self._engine.get_loc(casted_key)
   3082             except KeyError as err:
-> 3083                 raise KeyError(key) from err
   3084 
   3085         if tolerance is not None:

KeyError: 'E'