0
%matplotlib inline
import sys
import numpy as np
import scipy as sc
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

data = {'State':['Alabama', 'California', 'Delaware', 'Texas','Oregon','Arizona'],
        'Cases':[20, 210, 19, 1800, 25, 8020],
        'Deaths':[1,50,3,200,5,300]}

df_state = pd.DataFrame(data)
print(df_state.head(10))

plt.figure(figsize=(7, 7))
splot=sns.regplot(x=df_state["Cases"],y=df_state["Deaths"])
splot.set(xscale="log",yscale="log")
splot.set(xlim=(1, 10000))
splot.set(ylim=(1, 10000))

For above code, I'm not able to get a line fit. Please help me understand the reason.

Plot

0 Answers0