def generate_table(self):
gso_table = self._gso_table<EOL>gso_df = self.df<EOL>columns = list(gso_df.columns)<EOL>selected = gso_df[self.columns]<EOL>col_index = [(col, columns.index(col)) for col in self.columns]<EOL>keys = np.empty(selected.shape, dtype=np.uint64)<EOL>for o, (idx, row) in enumerate(selected.iterrows()):<EOL><INDENT>for j, (col, v) in enumerate(col_index):<EOL><INDENT>val = row[col]<EOL>val = '<STR_LIT>' if val is None else val<EOL>key = gso_table.get(val, None)<EOL>if key is None:<EOL><INDENT>key = (v + <NUM_LIT:1>, o + <NUM_LIT:1>)<EOL>gso_table[val] = key<EOL><DEDENT>keys[o, j] = self._convert_key(key)<EOL><DEDENT><DEDENT>for i, col in enumerate(self.columns):<EOL><INDENT>gso_df[col] = keys[:, i]<EOL><DEDENT>return gso_table, gso_df<EOL>
Generates the GSO lookup table for the DataFRame

Returns
-------
gso_table : OrderedDict
    Ordered dictionary using the string found as keys
    and their lookup position (v,o) as values
gso_df : DataFrame
    DataFrame where strl columns have been converted to
    (v,o) values

Notes
-----
Modifies the DataFrame in-place.

The DataFrame returned encodes the (v,o) values as uint64s. The
encoding depends on teh dta version, and can be expressed as

enc = v + o * 2 ** (o_size * 8)

so that v is stored in the lower bits and o is in the upper
bits. o_size is

  * 117: 4
  * 118: 6
  * 119: 5