def _features_as_kv(self):
        """
        Return features row as kv pairs so that they can be stored in memcache or redis and
        used at serving layer
        :return: a nested hash for each column
        """
        self._data = self.get_data()
        key_list = self.key()
        values_list = self.values()
        result = {}
        for column in values_list:
            key_prefix = self.cache_key_prefix() + "#" + column
            self._data['cache_key'] = self._data[key_list].apply(lambda xdf: key_prefix + "=" + '#'.join(xdf.astype(str).values), axis=1)
            result[column] = dict(zip(self._data.cache_key.values, self._data[column].values))
        return result
def _features_as_kv ( self ) : self . _data = self . get_data ( ) key_list = self . key ( ) values_list = self . values ( ) result = { } for column in values_list : key_prefix = self . cache_key_prefix ( ) + "#" + column self . _data [ 'cache_key' ] = self . _data [ key_list ] . apply ( lambda xdf : key_prefix + "=" + '#' . join ( xdf . astype ( str ) . values ) , axis = 1 ) result [ column ] = dict ( zip ( self . _data . cache_key . values , self . _data [ column ] . values ) ) return result
Return features row as kv pairs so that they can be stored in memcache or redis and
        used at serving layer
        :return: a nested hash for each column