以下是我试图读入pandas DataFrame的txt文件的一个子集:
ACW00011604 17.1167 -61.7833 10.1 ST JOHNS COOLIDGE FLD
ACW00011647 17.1333 -61.7833 19.2 ST JOHNS
AE000041196 25.3330 55.5170 34.0 SHARJAH INTER. AIRP GSN 41196
AEM00041194 25.2550 55.3640 10.4 DUBAI INTL 41194
AEM00041217 24.4330 54.6510 26.8 ABU DHABI INTL 41217
正如您所知,它使用空格作为分隔符,并且每个字段也缺少值和各种长度。架构是这样的:
Variable Columns Type
ID 1-11 Character
LATITUDE 13-20 Real
LONGITUDE 22-30 Real
ELEVATION 32-37 Real
STATE 39-40 Character
NAME 42-71 Character
GSN FLAG 73-75 Character
HCN/CRN FLAG 77-79 Character
WMO ID 81-85 Character
这样做的最佳方式是什么?