Python Forum
Auto row increment code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto row increment code
#3
Time being I have used Autofill was working with Range function however am not able to retrieve previous month value..
import pandas as pd

idx = pd.date_range('1/1/2020', '6/1/2020')

s = pd.Series({'1/1/2020': 1,
               '2/1/2020': 5,
               '4/1/2020': 10,
               '6/1/2020': 15})
s.index = pd.DatetimeIndex(s.index)

s = s.reindex(idx, fill_value=0)
print(s)
Reply


Messages In This Thread
Auto row increment code - by codesearcher - Sep-04-2020, 05:56 AM
RE: Auto row increment code - by ndc85430 - Sep-04-2020, 06:55 AM
RE: Auto row increment code - by codesearcher - Sep-04-2020, 09:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Use Python Packages to Increment a Column(not a row) ricmacharia 0 1,839 Jun-10-2019, 09:57 AM
Last Post: ricmacharia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020