I want to run a CoxTimeVaryingFitter on some data though I'm having some troubles with the add_covariate_to_timeline function which gives me the following error message:
File "C:\Anaconda3\lib\site-packages\pandas\core\generic.py", line 692, in rename 'argument "{0}"'.format(list(kwargs.keys())[0])) TypeError: rename() got an unexpected keyword argument "axis"**
from lifelines.utils import to_long_format
from lifelines.utils import add_covariate_to_timeline
l=data[data['duree']==1]
df=to_long_format(l,duration_col='duree')
h=data[data['duree']!=1]
dfj=add_covariate_to_timeline(df,h,id_col="id",duration_col="duree",event_col="mort")
I have run my code with the following dataframe 'data':
id;mort;var;bar;duree
1;0;0,5;0;1
2;0;0,1;11;1
3;0;-1;111;1
1;0;1;5;2
1;1;1,5;6;3
2;0;0,2;12;2
3;1;-2;121;2
2;0;0,3;13;3
2;1;0,4;14;4