from reamber.osu import OsuMap
stack = OsuMap.read_file("...").stack()
# Don't do this
stack.column[stack.offset < 1000] += 1
This raises a SettingWithCopy warning! This means, it might not have updated the stack by reference.
MapSet Stacking Caveats
When stacking with MapSet s, it will return a pd.DataFrame of the Map stack results. Due to copying caveats, conditional stacking will not work, loop through the maps and set individually.
from reamber.sm import SMMapSet
ms = SMMapSet.read_file("...")
stack = ms.stack()
stack.offset *= 2
If you want conditional stacking, loop and loc.
from reamber.sm import SMMapSet
ms = SMMapSet.read_file("...")
for m in ms:
s = m.stack()
s.loc[s.offset > 1000, 'column'] += 2
More Examples
To get acquainted with this, here are some additional examples. Learning this will be equivalent to learning pd.DataFrame conditional slicing and setting.
We assume stack = m.stack(), where m is a map if not specified.
First and Last Offsets
from reamber.osu import OsuMap
stack = OsuMap.read_file("...").stack()
first, last = stack.offset.min(), (stack.offset + stack.length).max()