Skip to content

Instantly share code, notes, and snippets.

@PengyuanLiu1993
Created October 21, 2018 17:55
Show Gist options
  • Save PengyuanLiu1993/fef6ea720a1f3551518da3ca2c3e375b to your computer and use it in GitHub Desktop.
Save PengyuanLiu1993/fef6ea720a1f3551518da3ca2c3e375b to your computer and use it in GitHub Desktop.
import pandas as pd
import os
list_path = []
os.chdir("/home/pengyuan/PycharmProjects/NASA_2018/")
for root, dirs, files in os.walk(".", topdown = False):
for name in files:
file_path = os.path.join(root, name)
list_path.append(file_path)
print(list_path)
# for name in dirs:
# print(os.path.join(root, name))
df = pd.DataFrame(list_path)
df.to_csv('./image_path.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment