【发布时间】:2020-04-07 03:37:02
【问题描述】:
我正在尝试在排除一定长度后打印文件名列表。以下是我目前所拥有的。
import glob
import numpy as np
import pandas as pd
path=r'Directory'
files=glob.glob(path + '/**/*.cod',recursive=True)
for i in files:
indat = pd.read_csv(i, skiprows=4, header=None, engine='python')
a=indat[8]
if len(a) >= 600:
print() #want a list of file names that the files that have length >=600.
【问题讨论】:
-
你试过
print(i)吗? -
@KaanE。谢谢!它工作。
-
no pb 也欢迎接受我的回答。
标签: python-3.x pandas for-loop if-statement