I have a DataFrame df like the following (excerpt, \'Timestamp\' are the index):
df
Timestamp Value 2012-06-01 00:00:00 100 2012-0
If the Timestamp column is a datetime value, then you can just use: df['weekday'] = df['Timestamp'].apply(lambda x: x.weekday())
Timestamp
datetime
df['weekday'] = df['Timestamp'].apply(lambda x: x.weekday())
or
df['weekday'] = pd.to_datetime(df['Timestamp']).apply(lambda x: x.weekday())