input: Write a function to create a machine learning model in Python that predicts customer lifetime value given a customer's past transactions. The function should import necessary libraries, preprocess the data, train a RandomForestRegressor model, and return the predicted lifetime value. If the given input data is empty, the function should return None.
  
  assert predict_cltv(pd.DataFrame([[10,100,5], [20,200,10]])) == 150
  assert predict_cltv(pd.DataFrame([[5,50,2], [15,150,7]])) == 100
  assert predict_cltv(pd.DataFrame()) == None
output: def predict_cltv(data):
      if data.empty:
          return None
      
      from sklearn.ensemble import RandomForestRegressor
      from sklearn.model_selection import train_test_split
      from sklearn.preprocessing import StandardScaler
      import pandas as pd
      
      X = data.iloc[:, :-1]
      y = data.iloc[:, -1]
      
      scaler = StandardScaler()
      X = scaler.fit_transform(X)
      
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      
      model = RandomForestRegressor(random_state=42)
      model.fit(X_train, y_train)
      
      return model.predict(X_test)[0]