Skip to content

Commit

Permalink
changed np.asscalar to object.item fixes scikit-tda#252
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagesh Danturti committed Jun 26, 2024
1 parent ece5d47 commit 1a3ba24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kmapper/visuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ def _render_d3_vis(
def my_dumper(obj, **kwargs):
def np_encoder(object, **kwargs):
if isinstance(object, np.generic):
return np.asscalar(object)
#return np.asscalar(object) <-- np.asscalar is deprecated in later versions of numpy
return object.item()

return json.dumps(obj, default=np_encoder, **kwargs)

Expand Down

0 comments on commit 1a3ba24

Please sign in to comment.