I'm trying to plot a mosaic plot on below dataframe, but it keeps sending error: 'ValueError: at least one proportion should be greater than zero' here is the dataframe:
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from statsmodels.graphics.mosaicplot import mosaic
Mortgage = [3839, 950]
Own = [1170, 183]
Rent = [3496, 362]
data = pd.DataFrame({'Mortgage' : Mortgage, 'Own' :Own, 'Rent': Rent})
mosaic(data, ['Mortgage', 'Own', 'Rent'])
plt.show()
Any thoughts? Thanks