Skip to content

Commit

Permalink
Merge pull request #60 from ubermag/numpy2
Browse files Browse the repository at this point in the history
Updates for numpy 2
  • Loading branch information
lang-m committed Jul 9, 2024
2 parents 1b05604 + a5d5807 commit 2b9d104
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ubermagtable/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def xmax(self):
24.999...
"""
return self.data[self.x].iloc[-1]
return self.data[self.x].iloc[-1].item()

def apply(self, func, columns=None, args=(), **kwargs):
r"""Apply function.
Expand Down Expand Up @@ -695,7 +695,8 @@ def slider(self, x=None, multiplier=None, description=None, **kwargs):
multiplier = ubermagutil.units.si_multiplier(self.xmax)

values = self.data[self.x].to_numpy()
labels = np.around(values / multiplier, decimals=2)
labels = np.around(values / multiplier, decimals=2).tolist()
values = values.tolist()
options = list(zip(labels, values))

units = f" ({ubermagutil.units.rsi_prefixes[multiplier]}s)" if x == "t" else ""
Expand Down

0 comments on commit 2b9d104

Please sign in to comment.