用read_fwf代替read_csv。 [read_fwf將fixed-width格式行的表讀入數(shù)據(jù)幀。https://pandas.pydata.org/docs/reference/api/pandas.read_fwf.html import pandas as pdcolspecs = ( (0, 44), (46, 47), (48, 49), (50, 51), (52, 53), (54, 55), (56, 57), (58, 59), (60, 66), (67, 73), (74, 77), (78, 80), (81, 84), (85, 87), (88, 90), (91, 95), (96, 99), (100, 103), (104, 106),) data_url = "http://jse.amstat.org/datasets/04cars.dat.txt"df = pd.read_fwf(data_url, colspecs=colspecs) df.columns = ( "Vehicle Name", "Is Sports Car", "Is SUV", "Is Wagon", "Is Minivan", "Is Pickup", "Is All-Wheel Drive", "Is Rear-Wheel Drive", "Suggeste