我正在尝试清理一些列,我遇到了一些事情。有一堆销售数据,每个产品都有二进制值。 附件是数据集的样本。 这个过程已经先到了dropna。然后,还有一些列值与所需的二进制值不匹配,如和11。= ' ']时,这是有效的,但是当我将它插入到clean_empty_string函数中时,我得到 ValueError: The truth value of a DataFrame is ambiguous下面是列的外观: ‘'Prod
我需要获取每个列的类型,以便对其进行适当的预处理。目前,我通过以下方法做到这一点:# but has one type (int, floatdf = pd.DataFrame(input, columns=key_labels)matrix = df.values
由于我只使用pandas获取数据类型(每<em
1)过滤熊猫中的数据;2)在过滤后的数据中的特定列中清除unicode文本。import pandas as pdfrom unidecode import unidecodedf1 =#reset index because otherwise indexes will be as per original dataframe现在,