Question: I know that "models" is a module of package django.db, But why we inherit like `class Foo(models.Model):` while the all required fields like CharField, IntegerField, etc. are part of models, what does the subclass Model do here exactly?

I am new to OOP and Django so any resources and answers are heavily appreciated and welcomed.

Answer: 
I'm not sure what weekday is doing here. Isn't it just extract the time and add one hour?

```
hours = df['Datetime'].dt.hour

df['TimeSlot'] = hours.astype(str) + "-" + hours.add(1).astype(str)

```

Output:

```
             Datetime  Transaction Item TimeSlot
0 2016-10-30 09:58:00            1    X     9-10
1 2016-10-30 10:05:00            2    Y    10-11
2 2016-10-30 14:48:00            3    Z    14-15

```
No problem for weekday, once you have converted the `Datetime` column to a true Timestamp type:

```
dt = pd.to_datetime(df['Datetime'])
df['Weekday'] = dt.dt.dayofweek

```

The slot is `_hour_-_hour+1_` except when you are about to change day where it becomes `23-0`.

You could do:

```
start_hour = dt.dt.hour
end_hour = pd.Series(np.where(start_hour == 23, 0, start_hour +1),
                     index=start_hour.index)
df['Slot'] = start_hour.astype(str) + '-' + end_hour.astype(str)

```