Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

complete dates pandas

import pandas as pd

idx = pd.date_range('09-01-2013', '09-30-2013')

s = pd.Series({'09-02-2013': 2,
               '09-03-2013': 10,
               '09-06-2013': 5,
               '09-07-2013': 1})
s.index = pd.DatetimeIndex(s.index)

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

PREVIOUS NEXT
Code Example
Python :: python remove item from a list 
Python :: add colorbar matplotlib 
Python :: python remove header 
Python :: python remove item from list 
Python :: log in python 
Python :: list of dictionary values 
Python :: fetch json array from mysql django 
Python :: fast way to load mongodb data into python list 
Python :: where to put capybara default wait time 
Python :: change gles3 to gles2 
Python :: find occerences in list python 
Python :: how to stop auto log writing by other function in python 
Python :: python enumerate() 
Python :: Failed to build wxPython 
Python :: how to plot side by side bar horizontal bar graph in python 
Python :: Resource stopwords not found 
Python :: python list comprehension nested loop 
Python :: unpacking in python 
Python :: how to use drive link in pandas dataframe 
Python :: every substring python 
Python :: how to get max value and min values in entire dataframe 
Python :: matplotlib boxplot change size of outliers 
Python :: call python from bash shell 
Python :: binary search iterative 
Python :: min stack in python 
Python :: python elementTree tostring write() argument must be str, not bytes 
Python :: easy python gui 
Python :: add last item of array at the first index of the array python 
Python :: bst deleting in python 
Python :: python global lists 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =