我对一些变量进行了热编码,经过一些计算后,我想要检索原始的变量。我正在做的事情如下: 我过滤了一个热编码的列名(它们都以原始变量的名称开头,假设是'mycol') filter_col = [col for col in df if col.startswith('我如何从中创建一个变量呢?作为请求,下面是一个取自here的示例 df= pd.DataFrame({
'mycol':np.random.choi
假设dataframe (df)的字符串变量(Sex)编码为('M‘或'F')。Sex'].astype('category)cph.fit(df, duration_col='time', event_col='event')ValueError: could not convert string to float: 'M'
这可以通过使用以下几种方法之一将“Sex”<e