Python Forum
Replacing missing years in the dataframe - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Replacing missing years in the dataframe (/thread-9012.html)



Replacing missing years in the dataframe - sangeethasivakumar - Mar-17-2018

To replace the missing year and the corresponding columns with zeros. My dataframe looks like this,

Year Churn_Count Churn_Rate Customer_Count
2008 1071.0 0.800149 4114
2012 0.0 0.000000 6
2013 233.0 0.174075 824
2014 101.0 0.075458 410

I need to fill the missing year in between 2008 to 2014 ,

for example, 2009,2010, 2011 is missing how to fill these year in between and corresponding columns with zeros