Skip to content

Commit

Permalink
wrappers: explicitly case discrete states to unicode to avoid str~flo…
Browse files Browse the repository at this point in the history
…at comparison when pandas parses missing data as np.nan
  • Loading branch information
rneher committed Oct 18, 2019
1 parent d1b8cab commit 24a6f4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion treetime/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def mugration(params):
attr = states.columns[1]
print("Attribute for mugration inference was not specified. Using "+attr, file=sys.stderr)

leaf_to_attr = {x[taxon_name]:x[attr] for xi, x in states.iterrows()
leaf_to_attr = {x[taxon_name]:str(x[attr]) for xi, x in states.iterrows()
if x[attr]!=params.missing_data}

mug, letter_to_state, reverse_alphabet = reconstruct_discrete_traits(params.tree, leaf_to_attr, missing_data=params.missing_data,
Expand Down

0 comments on commit 24a6f4a

Please sign in to comment.