(1).xls文件的读取
import pandas as pd
def excel_one_line_to_list():
df = pd.read_excel("XXX.xls", usecols=[0], names=None)
print(df)
if __name__ == '__main__':
excel_one_line_to_list()
(2).csv文件的读取
df = pd.read_csv('XXX.csv', encoding='gbk')
print(df.head())
print(df.fanzui)
(3).txt文件的读取
datafile = 'ZZZ.txt'
data_practice, data_predict = read(datafile)