与这篇文章类似,get one specific line of comment as header with python Pandas 如何仅使用pandas获得注释之间的列名?File.csv: #Comment1#Comment2
data1|data2|data3 我可以通过一些预处理来做到这一点,但这只能用pandas来完成吗?headers=1将#comments2保留在数据帧中,但它将列的数据
我需要获取每个列的类型,以便对其进行适当的预处理。目前,我通过以下方法做到这一点:# but has one type (int, floatdf = pd.DataFrame(input, columns=key_labels)matrix = df.values
由于我只使用pandas获取数据类型(每列),
我想将我的数据分成标签,因为前6列决定了第7列,现在我已经选择了前6列,它工作得很好 import pandas as pdfrommaint', 'doors', 'persons', 'lug_boot','safety', 'class']
# load the dataset in csv format into the pandas它