擅长:python、mysql、java
<p>您可以在脚本中获取CSV文件的列表,并在其上循环。在</p>
<pre><code>from os import listdir
from os.path import isfile, join
mypath = os.getcwd()
csvfiles = [f for f in listdir(mypath) if isfile(join(mypath, f)) if '.csv' in f]
for f in csvfiles:
pd.read_csv(f)
# the rest of your script
</code></pre>