Skip to content
Advertisement

Tag: series

Pandas data frame index

if I have a Series But, I need a standard index = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], with index[4, 7, 8] values equal to zeros. So I expect the updated series will be How should I update the series? Thank you in advance! Answer Try this: Output:

How to reverse a pandas series

I have a pandas series that must be flipped upside-down before I concatenate it to the main DataFrame. I can easily flip it with myseries = myseries.iloc[::-1] But when I attach it to the main DataFrame, it attaches the default series and not the flipped version. Why doesn’t the flipped series stay in place? EDIT: So my guess is that

Advertisement