Skip to main content
Version: Python

How do I shift values in columns?

Use special variables i or ii if your table is static and append-only. If your table is ticking, or not append-only, use update_by with rolling_group_tick. Using i looks like:

result = source.update(["ColShiftedUpOne = Col_[i - 1]", "ColShiftedDownOne = Col_[i + 1]]")
note

These FAQ pages contain answers to questions about Deephaven Community Core that our users have asked in our Community Slack. If you have a question that is not in our documentation, join our Community and we'll be happy to help!