[python] 폴더 내의 모든 파일 가져오기 코드

# use glob to get all the csv files
# in the folder
# path = os.getcwd()
path = os.getcwd()
csv_files = glob.glob(os.path.join(path, "*.csv"))
# loop over the list of csv files
for f in csv_files:
    # read the csv file
    df = pd.read_csv(f)
    # print the location and filename
    print('Location:', f)
    print('File Name:', f.split("\\")[-1])
    # print the content
    print('Content:')
    # display(df)