I have a dataset with date-time values like this,

```
           datetime
0          2012-04-01 07:00:00 
.          .
.          .  

```

I would like to create separate columns of **weekday, hour, month** like,

```
           datetime             weekday_1 ... weekday_7  hour_1 ... hour_7 ... hour_24  month_1 ... month_4 ... month_12 
0          2012-04-01 07:00:00     0             1         0         1            0       0             1           0

```

*(taking monday as weekday\_1, the example date is sunday: weekday\_7)*

The only way I know how to extract from datetime is this,

```
df['month'] = df['datetime'].dt.month 

```

But I cannot seem to apply this to fit my problem.

Sorry if this sounds repetitive, i am fairly new to this. But similar question answers were not helpful enough.
Thanks in advance.