input: Write a python function to create features from a dataset with date column and one-hot encode categorical features.
  assert set(create_features(pd.DataFrame({'date': ['2021-02-28'], 'type': ['Party'], 'location': ['San Francisco, CA']})).columns) == {'month', 'day', 'day_of_week', 'year', 'type_Party', 'location_San Francisco, CA'}
  assert create_features(pd.DataFrame({'date': ['2021-12-25'], 'type': ['Conference'], 'location': ['New York, NY']})).shape == (1, 6)
  assert create_features(pd.DataFrame({'date': ['2020-01-01'], 'type': ['Meeting'], 'location': ['Los Angeles, CA']})).iloc[0]['year'] == 2020
output: def create_features(df):
      # Convert date column to datetime
      df['date'] = pd.to_datetime(df['date'])
      
      # Extract date features
      df['year'] = df['date'].dt.year
      df['month'] = df['date'].dt.month
      df['day'] = df['date'].dt.day
      df['day_of_week'] = df['date'].dt.dayofweek
      
      # Drop the original date column
      df = df.drop('date', axis=1)
      
      # One-hot encode categorical features
      df = pd.get_dummies(df, columns=['type', 'location'])
      
      return df