<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def partial_transform(self, traj):
 """Slice a single input array along to select a subset of features. Parameters traj : np.ndarray, shape=(n_samples, n_features) A sample to slice. Returns ------- sliced_traj : np.ndarray shape=(n_samples, n_feature_subset) Slice of traj """

        if self.index is not None:
            return traj[:, self.index]
        else:
            return traj[:, :self.first]