def __convert_none_to_zero ( self , ts ) : if not ts : return ts ts_clean = [ val if val else 0 for val in ts ] return ts_clean
remove if 0 from series python
Convert None values to 0 so the data works with Matplotlib : param ts : : return : a list with 0s where Nones existed
def __convert_none_to_zero(self, ts):
        """
        Convert None values to 0 so the data works with Matplotlib
        :param ts:
        :return: a list with 0s where Nones existed
        """

        if not ts:
            return ts

        ts_clean = [val if val else 0 for val in ts]

        return ts_clean