input: Write a function to create and train a decision tree classifier using sklearn.
  assert len(decision_tree_classifier(df1)) == len(df1) * 0.3
  assert isinstance(decision_tree_classifier(df2), np.ndarray)
  assert decision_tree_classifier(df3).shape == (int(len(df3) * 0.3),)
output: def decision_tree_classifier(df):
      from sklearn.model_selection import train_test_split
      from sklearn.tree import DecisionTreeClassifier
      import numpy as np
  
      # Assuming the last column is the target variable
      X = df.iloc[:, :-1]
      y = df.iloc[:, -1]
  
      # Split the data into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
  
      # Create and train the decision tree classifier
      clf = DecisionTreeClassifier()
      clf.fit(X_train, y_train)
  
      # Predict the target variable for the test set
      y_pred = clf.predict(X_test)
  
      return y_pred