Pandas Tutorial | How to shift rows or indexes using shift method

preview_player
Показать описание

When freq is not passed, shift the index without realigning the data. If freq is passed (in this case, the index must be date or datetime, or it will raise a NotImplementedError), the index will be increased using the periods and the freq.

Buy Me a Coffee? Your support is much appreciated!
Venmo: @Jie-Jenn

Get Source Code:

More tutorial videos on my website

Check out my gears here on Amazon:
Рекомендации по теме
Комментарии
Автор

what if I want to shift multiindex? I research aabout trading data. For example, Index stock name, and index date. How can I do it?

What python studio you are using?
thank you

dungnguyenngoc
Автор

What if .shift() is used with no values? What does the code do?

billyenaire