Open hailee8899 opened 1 year ago
同样的问题,甚至删掉所有字符串还是会报错
我也遇到了这个问题,官方文档上的展示数据中不就有字符串类型的数据吗,但是我运行时报错 下面是报错内容: selected_data, drop_lst = toad.selection.select( data_tr,target = 'TARGET',empty = 0.5, iv=0.05, corr=0.7,return_drop=True ) Traceback (most recent call last):
Cell In[15], line 1 selected_data, drop_lst = toad.selection.select(
File D:\anaconda3\Lib\site-packages\toad\selection.py:517 in select frame, corr_drop = drop_corr(frame, target = target, threshold = corr, by = weights, return_drop = True, exclude = exclude)
File D:\anaconda3\Lib\site-packages\toad\selection.py:329 in drop_corr corr = f.corr().abs()
File D:\anaconda3\Lib\site-packages\pandas\core\frame.py:10054 in corr mat = data.to_numpy(dtype=float, na_value=np.nan, copy=False)
File D:\anaconda3\Lib\site-packages\pandas\core\frame.py:1838 in to_numpy result = self._mgr.as_array(dtype=dtype, copy=copy, na_value=na_value)
File D:\anaconda3\Lib\site-packages\pandas\core\internals\managers.py:1732 in as_array arr = self._interleave(dtype=dtype, na_value=na_value)
File D:\anaconda3\Lib\site-packages\pandas\core\internals\managers.py:1794 in _interleave result[rl.indexer] = arr
ValueError: could not convert string to float: 'F'
@hailee8899 @Aryooo @AnnaYang2223 I think its same to #133 , the issue with pandas >=2.0.x, please upgrade toad to 0.1.3 and have a try. 😄
thanks
官方文档 https://toad.readthedocs.io/en/latest/tutorial.html 这里的例子并没有说明不支持处理字符串变量。
但是我用了同样的代码和数据,从代码的报错信息来看是不支持的,请大家帮忙解答一下疑惑。