docs: def apply(self, df):
          """Takes a pd.DataFrame and returns the newly defined column, i.e.
          a pd.Series that has the same index as `df`.
          """
          if hasattr(self.definition, '__call__'):
              r = self.definition(df)
          elif self.definition in df.columns:
              r = df[self.definition]
          elif not isinstance(self.definition, string_types):
              r = pd.Series(self.definition, index=df.index)
          else:
              raise ValueError("Invalid column definition: %s" % str(self.definition))
          return r.astype(self.astype) if self.astype else r