def from_data(data):
if len(data) == <NUM_LIT:0>:  <EOL><INDENT>return None<EOL><DEDENT>else:<EOL><INDENT>ptable = PrettyTable()<EOL>ptable.field_names = data[<NUM_LIT:0>].keys()<EOL>for row in data:<EOL><INDENT>ptable.add_row(row)<EOL><DEDENT>return ptable<EOL><DEDENT>
Construct a Prettytable from list of rows.

:rtype: PrettyTable