Skip to content
Advertisement

Pandas data frame index

if I have a Series

JavaScript

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

JavaScript

How should I update the series? Thank you in advance!

Advertisement

Answer

Try this:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement