pandas 读取大量数据

要读取文件夹下所有文件, 各个文件行数不同(dfsensor:6 万列),如何能快速读取呢?
现有方式大概要花3分钟, 后续数据会更多

pandas 读取大量数据

    filenames = os.listdir(inputdir)

dftable = pd.DataFrame()

for filename in filenames:

#filename = filenames[0]

dfsensor = apo.read_wafer_OES(os.path.join(inputdir,filename))

dfsensor.insert(0, "PJID_Slot", dfsensor['PJID'] + '#' + dfsensor['Slot'].astype(str) )

infoCol = dfsensor.columns[:20].tolist()

allsensors = dfsensor.columns.tolist()

(RFH_sensors,OES_sensors,measure_sensors) = ap.define_sensor_type(allsensors) # use avg for RFH data

df = dfsensor[infoCol + OES_sensors + RFH_sensors]

dftable = dftable.append(df)

del dfsensor

del df

以上是 pandas 读取大量数据 的全部内容, 来源链接: utcz.com/p/938426.html

回到顶部