인프런 커뮤니티 질문&답변

가후님의 프로필 이미지
가후

작성한 질문수

처음하는 파이썬 데이터 분석 (쉽게! 전처리, pandas, 시각화 전과정 익히기) [데이터분석/과학 Part2]

pandas 라이브러리로 실제 데이터 전처리하기4

강의에 없는 내용인데 질문드려도 되나요?

작성

·

218

0

import os

PATH = 'COVID-19-master/csse_covid_19_data/csse_covid_19_daily_reports/'

file_lsit = os.listdir(PATH)

for file in file_list:

    if file.split(".")[-1] == 'csv':

        csv_list.append(file)

        

print(csv_list)

이렇게 코드를 작성해보았습니다 ( csv_list = list()  이걸빼고 작성해봄, 이 코드가 왜 들어가야 하는지 모르겠어요 ㅠㅠ) 

실행해보니 값이 두번출력되네요..

왜 두번 출력되는지 여쭤봐도 되나요?

['01-22-2020.csv', '01-23-2020.csv', '01-24-2020.csv', '01-25-2020.csv', '01-26-2020.csv', '01-27-2020.csv', '01-28-2020.csv', '01-29-2020.csv', '01-30-2020.csv', '01-31-2020.csv', '02-01-2020.csv', '02-02-2020.csv', '02-03-2020.csv', '02-04-2020.csv', '02-05-2020.csv', '02-06-2020.csv', '02-07-2020.csv', '02-08-2020.csv', '02-09-2020.csv', '02-10-2020.csv', '02-11-2020.csv', '02-12-2020.csv', '02-13-2020.csv', '02-14-2020.csv', '02-15-2020.csv', '02-16-2020.csv', '02-17-2020.csv', '02-18-2020.csv', '02-19-2020.csv', '02-20-2020.csv', '02-21-2020.csv', '02-22-2020.csv', '02-23-2020.csv', '02-24-2020.csv', '02-25-2020.csv', '02-26-2020.csv', '02-27-2020.csv', '02-28-2020.csv', '02-29-2020.csv', '03-01-2020.csv', '03-02-2020.csv', '03-03-2020.csv', '03-04-2020.csv', '03-05-2020.csv', '03-06-2020.csv', '03-07-2020.csv', '03-08-2020.csv', '03-09-2020.csv', '03-10-2020.csv', '03-11-2020.csv', '03-12-2020.csv', '03-13-2020.csv', '03-14-2020.csv', '03-15-2020.csv', '03-16-2020.csv', '03-17-2020.csv', '03-18-2020.csv', '03-19-2020.csv', '03-20-2020.csv', '03-21-2020.csv', '03-22-2020.csv', '03-23-2020.csv', '03-24-2020.csv', '03-25-2020.csv', '03-26-2020.csv', '03-27-2020.csv', '03-28-2020.csv', '03-29-2020.csv', '03-30-2020.csv', '03-31-2020.csv', '04-01-2020.csv', '04-02-2020.csv', '04-03-2020.csv', '04-04-2020.csv', '04-05-2020.csv', '04-06-2020.csv', '04-07-2020.csv', '04-08-2020.csv', '04-09-2020.csv', '04-10-2020.csv', '04-11-2020.csv', '04-12-2020.csv', '04-13-2020.csv', '04-14-2020.csv', '04-15-2020.csv', '04-16-2020.csv', '04-17-2020.csv', '04-18-2020.csv', '04-19-2020.csv', '04-20-2020.csv', '04-21-2020.csv', '04-22-2020.csv', '04-23-2020.csv', '04-24-2020.csv', '04-25-2020.csv', '04-26-2020.csv', '04-27-2020.csv', '04-28-2020.csv', '04-29-2020.csv', '04-30-2020.csv', '05-01-2020.csv', '05-02-2020.csv', '05-03-2020.csv', '05-04-2020.csv', '05-05-2020.csv', '05-06-2020.csv', '05-07-2020.csv', '05-08-2020.csv', '05-09-2020.csv', '05-10-2020.csv', '05-11-2020.csv', '05-12-2020.csv', '05-13-2020.csv', '05-14-2020.csv', '05-15-2020.csv', '05-16-2020.csv', '05-17-2020.csv', '05-18-2020.csv', '05-19-2020.csv', '05-20-2020.csv', '05-21-2020.csv', '05-22-2020.csv', '05-23-2020.csv', '05-24-2020.csv', '05-25-2020.csv', '05-26-2020.csv', '05-27-2020.csv', '05-28-2020.csv', '05-29-2020.csv', '05-30-2020.csv', '05-31-2020.csv', '06-01-2020.csv', '06-02-2020.csv', '06-03-2020.csv', '06-04-2020.csv', '06-05-2020.csv', '06-06-2020.csv', '06-07-2020.csv', '06-08-2020.csv', '06-09-2020.csv', '06-10-2020.csv', '06-11-2020.csv', '06-12-2020.csv', '06-13-2020.csv', '06-14-2020.csv', '06-15-2020.csv', '06-16-2020.csv', '06-17-2020.csv', '01-22-2020.csv', '01-23-2020.csv', '01-24-2020.csv', '01-25-2020.csv', '01-26-2020.csv', '01-27-2020.csv', '01-28-2020.csv', '01-29-2020.csv', '01-30-2020.csv', '01-31-2020.csv', '02-01-2020.csv', '02-02-2020.csv', '02-03-2020.csv', '02-04-2020.csv', '02-05-2020.csv', '02-06-2020.csv', '02-07-2020.csv', '02-08-2020.csv', '02-09-2020.csv', '02-10-2020.csv', '02-11-2020.csv', '02-12-2020.csv', '02-13-2020.csv', '02-14-2020.csv', '02-15-2020.csv', '02-16-2020.csv', '02-17-2020.csv', '02-18-2020.csv', '02-19-2020.csv', '02-20-2020.csv', '02-21-2020.csv', '02-22-2020.csv', '02-23-2020.csv', '02-24-2020.csv', '02-25-2020.csv', '02-26-2020.csv', '02-27-2020.csv', '02-28-2020.csv', '02-29-2020.csv', '03-01-2020.csv', '03-02-2020.csv', '03-03-2020.csv', '03-04-2020.csv', '03-05-2020.csv', '03-06-2020.csv', '03-07-2020.csv', '03-08-2020.csv', '03-09-2020.csv', '03-10-2020.csv', '03-11-2020.csv', '03-12-2020.csv', '03-13-2020.csv', '03-14-2020.csv', '03-15-2020.csv', '03-16-2020.csv', '03-17-2020.csv', '03-18-2020.csv', '03-19-2020.csv', '03-20-2020.csv', '03-21-2020.csv', '03-22-2020.csv', '03-23-2020.csv', '03-24-2020.csv', '03-25-2020.csv', '03-26-2020.csv', '03-27-2020.csv', '03-28-2020.csv', '03-29-2020.csv', '03-30-2020.csv', '03-31-2020.csv', '04-01-2020.csv', '04-02-2020.csv', '04-03-2020.csv', '04-04-2020.csv', '04-05-2020.csv', '04-06-2020.csv', '04-07-2020.csv', '04-08-2020.csv', '04-09-2020.csv', '04-10-2020.csv', '04-11-2020.csv', '04-12-2020.csv', '04-13-2020.csv', '04-14-2020.csv', '04-15-2020.csv', '04-16-2020.csv', '04-17-2020.csv', '04-18-2020.csv', '04-19-2020.csv', '04-20-2020.csv', '04-21-2020.csv', '04-22-2020.csv', '04-23-2020.csv', '04-24-2020.csv', '04-25-2020.csv', '04-26-2020.csv', '04-27-2020.csv', '04-28-2020.csv', '04-29-2020.csv', '04-30-2020.csv', '05-01-2020.csv', '05-02-2020.csv', '05-03-2020.csv', '05-04-2020.csv', '05-05-2020.csv', '05-06-2020.csv', '05-07-2020.csv', '05-08-2020.csv', '05-09-2020.csv', '05-10-2020.csv', '05-11-2020.csv', '05-12-2020.csv', '05-13-2020.csv', '05-14-2020.csv', '05-15-2020.csv', '05-16-2020.csv', '05-17-2020.csv', '05-18-2020.csv', '05-19-2020.csv', '05-20-2020.csv', '05-21-2020.csv', '05-22-2020.csv', '05-23-2020.csv', '05-24-2020.csv', '05-25-2020.csv', '05-26-2020.csv', '05-27-2020.csv', '05-28-2020.csv', '05-29-2020.csv', '05-30-2020.csv', '05-31-2020.csv', '06-01-2020.csv', '06-02-2020.csv', '06-03-2020.csv', '06-04-2020.csv', '06-05-2020.csv', '06-06-2020.csv', '06-07-2020.csv', '06-08-2020.csv', '06-09-2020.csv', '06-10-2020.csv', '06-11-2020.csv', '06-12-2020.csv', '06-13-2020.csv', '06-14-2020.csv', '06-15-2020.csv', '06-16-2020.csv', '06-17-2020.csv']

답변 1

0

안녕하세요. 이 부분은 양해를 부탁드립니다.

강의외적으로 각자 작성하신 코드까지 분석해서 답변드리기에는 저도 해당 코드를 작성해보기도 해야 정확한 답변도 드릴 수 있고, 다소 무리가 있고요. 지금 설명하신 부분이 무슨 이야기인지 정확히는 모르겠는데요. csv_list = list() 를 빼셨다고 하니, 본래 리스트에 추가로 한번더 들어가서 그런듯 합니다.

가후님의 프로필 이미지
가후

작성한 질문수

질문하기