def structs2pandas(structs):
try:<EOL><INDENT>import pandas<EOL>records = list(structs2records(structs))<EOL>df = pandas.DataFrame.from_records(records)<EOL>if '<STR_LIT:id>' in df:<EOL><INDENT>df["<STR_LIT:id>"] = df["<STR_LIT:id>"].apply(str.rstrip)<EOL><DEDENT>return df<EOL><DEDENT>except ImportError:<EOL><INDENT>return structs<EOL><DEDENT>
convert ctypes structure or structure array to pandas data frame