dfs0tocsv

import pandas as pd
import mikeio
import glob
import re

mainpath = r'E:\zj_ocean_ds\aj_bc_wt2'
ff = glob.glob(mainpath + r'\*.dfs0')
ty = []
df1 = pd.DataFrame()
n = 0
f = ff[3]

for f in ff:
tt = re.findall(r'TS_\d*', f)[0]
dfs = mikeio.read(f)

df = dfs.to_dataframe()
a = df['Zeros']
df1[tt] = a


df1.to_csv('bianjie.csv')
posted @ 2023-03-21 10:22  云飞01  阅读(22)  评论(0编辑  收藏  举报