Here is the Demo:

```
import pandas as pd
from datetime import datetime

df_test2 = pd.DataFrame({'dt_str': {0: '03/01/2017-09:16:00',
  1: '03/01/2017-09:17:00',
  2: '03/01/2017-09:18:00',
  3: '03/01/2017-09:19:00',
  4: '03/01/2017-09:20:00'},
 'Open': {0: 21920, 1: 21945, 2: 21940, 3: 21981, 4: 21988},
 'Close': {0: 21945, 1: 21940, 2: 21981, 3: 21988, 4: 21977},
 'Volume': {0: 935, 1: 541, 2: 651, 3: 314, 4: 318}})

df_test2['dt'] = df_test2['dt_str'].apply(lambda x: datetime.strptime(x, '%d/%m/%Y-%H:%M:%S'))

df_test2.reset_index(drop=True, inplace=True)
df_test2.set_index('dt', inplace=True)

# The question is how can I get the value of the datetime index in lambda function

def condition(x):
    # handling index value, like checking the datetime's weekday
    print(x['dt'].weekday())
    return True

df_test2.apply(lambda x: condition(x), axis=1)

```

When I'm calling `x['dt']` it raised Key error:

```
KeyError                                  Traceback (most recent call last)

xxx
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: 'dt'

```

Update
------

if I use `x.index`, it raised:

```
AttributeError: 'Index' object has no attribute 'weekday'

```