-
-
Save PengyuanLiu1993/fef6ea720a1f3551518da3ca2c3e375b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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