File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {"string with backandquote \\\" " :1 , "string with back\\ " :2 }
Original file line number Diff line number Diff line change 1+ import os
2+ import csv
3+
4+ try : import pandas as pd
5+ except ImportError :
6+ import pip
7+ pip .main (['install' , '--user' , 'pandas' ])
8+ import pandas as pd
9+
10+ def getdata (filename ):
11+ df = pd .read_csv (filename , delim_whitespace = True )
12+ return (df ["gb_per_s" ].tolist ())
13+
14+ ourdir = os .path .dirname (os .path .realpath (__file__ ))
15+ answer = []
16+ for file in os .listdir (ourdir ):
17+ if file .startswith ("all" ) and file .endswith (".table" ):
18+ fullpath = os .path .join (ourdir , file )
19+ answer .append ([file [3 :- 11 ]]+ getdata (fullpath ))
20+ print (" \t &\t simdjson \t &\t RapidJSON \t &\t RapidJSONinsitu \t &\t sajsondyn \t &\t sajson \t &\t dropbox-json11 \t &\t fastjson \t &\t gason \t &\t ultrajson \t &\t jsmn\t &\t cJSON \\ \\ " )
21+ answer .sort ()
22+ for l in answer :
23+ print ("\t &\t " .join (map (lambda x : (('{:.2f}' .format (x ) if x < 1 else '{:.1f}' .format (x ) ) if (type (x ) is float ) else x ),l ))+ "\\ \\ " )
You can’t perform that action at this time.
0 commit comments