Reputation: 1461
I have tried to run the following code. but it gives an argument required error in lifelines/plotting.py file. i can't fix it .
import pandas as pd
from lifelines.datasets import load_dd
import matplotlib.pyplot as plt
data = load_dd()
print data.sample(6)
from lifelines import KaplanMeierFitter
kmf = KaplanMeierFitter()
T = data["duration"]
E = data["observed"]
kmf.fit(T, event_observed=E)
kmf.survival_function_.plot()
plt.title('Survival function of political regimes');
kmf.plot()
plt.show()
but it gives the following error
Traceback (most recent call last): File "/Users/rabindra/PycharmProjects/SurvivalAnalysis/sources/main.py", line 17, in <module>
kmf.plot() File "/Library/Python/2.7/site-packages/lifelines/plotting.py", line 331, in plot
set_kwargs_color(kwargs) File "/Library/Python/2.7/site-packages/lifelines/plotting.py", line 223, in set_kwargs_color
kwargs["ax"]._get_lines.get_next_color()) AttributeError: '_process_plot_var_args' object has no attribute 'get_next_color'
Upvotes: 4
Views: 4213
Reputation: 570
Rolled back matplotlib version to 3.7 and my librosa plots are now showing
Upvotes: -1
Reputation: 323
you can also refer here
Roll back matplotlib to 3.7, or use the development version of librosa from the GitHub repo.
This is working fine for python versions >3.9
Upvotes: 2
Reputation: 29
I was facing the same issue.
Upgraded lifelines to 0.14.0 and matplotlib to 2.2.2 and it works.
Upvotes: 2