首页 > 其他分享 >dfs0tocsv

dfs0tocsv

时间:2023-03-21 10:33:39浏览次数:32  
标签:df tt dfs glob ff csv 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')

标签:df,tt,dfs,glob,ff,csv,dfs0tocsv
From: https://www.cnblogs.com/chenyun-delft3d/p/17239036.html

相关文章