Fix error in survtime_to_numeric when applied to 1D data
This commit is contained in:
parent
f2987bfd2d
commit
00ed38d47d
@ -331,7 +331,7 @@ def survtime_to_numeric(df, time, time2=None):
|
||||
df[time] = df[time].dt.total_seconds()
|
||||
max_time = df[time].max()
|
||||
|
||||
if df[time2].dtype == '<m8[ns]':
|
||||
if time2 and df[time2].dtype == '<m8[ns]':
|
||||
df[time2] = df[time2].dt.total_seconds()
|
||||
max_time = max(max_time or 0, df[time2].max())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user