srush HF staff commited on
Commit
abcc787
1 Parent(s): 1365127

Upload with huggingface_hub

Browse files
Files changed (1) hide show
  1. table.py +1 -1
table.py CHANGED
@@ -40,7 +40,7 @@ names = {
40
  def to_df(d):
41
  players = {player for v in d.values() if v is not None for player, _ in v.items()}
42
  lookup = {k: {a: b for a, b in v.items()} for k,v in d.items()}
43
- rows = [{"player": p} | {k: "_" if p not in lookup.get(k, []) else lookup[k][p] for k in names.keys()}
44
  for p in players]
45
  return pd.DataFrame.from_dict(rows).astype("str").sort_values(axis=0, by="player", ignore_index=True).transpose()
46
 
 
40
  def to_df(d):
41
  players = {player for v in d.values() if v is not None for player, _ in v.items()}
42
  lookup = {k: {a: b for a, b in v.items()} for k,v in d.items()}
43
+ rows = [dict(**{"player": p}, **{k: "_" if p not in lookup.get(k, []) else lookup[k][p] for k in names.keys()})
44
  for p in players]
45
  return pd.DataFrame.from_dict(rows).astype("str").sort_values(axis=0, by="player", ignore_index=True).transpose()
46