我有大量的目录,其中有不同的列和每列的不同标题名称,其中每个标题名称的描述在我的 ascii 文件的开头作为注释给出。将它们读入一段pandas.DataFrame
时间的最佳方法是什么,它也可以设置列的名称,而无需从一开始就定义它。以下是我的目录示例:
# 1 MAG_AUTO Kron-like elliptical aperture magnitude [mag]
# 2 rh half light radius (analyse) [pixel]
# 3 MU_MAX Peak surface brightness above background [mag * arcsec**(-2)]
# 4 FWHM_IMAGE FWHM assuming a gaussian core [pixel]
# 5 CLASS_STAR S/G classifier output
18.7462 4.81509 20.1348 6.67273 0.0286538
18.2440 7.17988 20.6454 21.6235 0.0286293
18.3102 3.11273 19.0960 8.26081 0.0430532
21.1751 2.92533 21.9931 5.52080 0.0290418
19.3998 1.86182 19.3166 3.42346 0.986598
20.0801 3.52828 21.3484 6.76799 0.0303842
21.9427 2.08458 22.0577 5.59344 0.981466
20.7726 1.86017 20.8130 3.69570 0.996121
23.0836 2.23427 23.3689 4.49985 0.706207
23.2443 1.62021 23.1089 3.54191 0.973419
20.6343 3.99555 21.9426 6.94700 0.0286164
23.4012 2.00408 23.3412 4.35926 0.946349
23.8427 1.54819 23.8241 3.83407 0.897079
20.3344 2.69910 20.9401 4.38988 0.0355277
21.7506 2.43451 22.2115 4.62045 0.0786921