Skip to content

Commit

Permalink
apply should return dict, not DataFrame
Browse files Browse the repository at this point in the history
- e.g. when getting contributions from models
  • Loading branch information
dbrakenhoff committed Oct 26, 2023
1 parent d6d44e7 commit 0ec3a44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pastastore/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def apply(self, libname, func, names=None, progressbar=True):
Returns
-------
dict
dict of results of func, with names as keys and result as values
dict of results of func, with names as keys and results as values
"""
names = self.conn._parse_names(names, libname)
result = {}
Expand All @@ -1122,4 +1122,4 @@ def apply(self, libname, func, names=None, progressbar=True):
getter = getattr(self.conn, f"get_{libname}")
for n in tqdm(names) if progressbar else names:
result[n] = func(getter(n))
return pd.DataFrame.from_dict(result, orient="index")
return result

0 comments on commit 0ec3a44

Please sign in to comment.