Skip to Main Content
파이썬 데이터 분석 입문: 엑셀 및 CSV 파일 처리부터 데이터베이스, 시각화, 통계분석, 자동화까지
book

파이썬 데이터 분석 입문: 엑셀 및 CSV 파일 처리부터 데이터베이스, 시각화, 통계분석, 자동화까지

by 한창진, 이병욱, 클린턴 브라운리
November 2017
Beginner to intermediate content levelBeginner to intermediate
368 pages
7h 48m
Korean
Hanbit Media, Inc.
Content preview from 파이썬 데이터 분석 입문: 엑셀 및 CSV 파일 처리부터 데이터베이스, 시각화, 통계분석, 자동화까지
197
3
엑셀 파일
data _from _multiple _workbooks.py
로 저장한다.
#!/usr/bin/env python3
import pandas as pd
import glob
import os
import sys
input_path = sys.argv[1]
output_file = sys.argv[2]
all_workbooks = glob.glob(os.path.join(input_path,'*.xls*'))
data_frames = []
for workbook in all_workbooks:
all_worksheets = pd.read_excel(workbook, sheetname=None, index_col=None)
for worksheet_name, data in all_worksheets.items():
data_frames.append(data)
all_data_concatenated = pd.concat(data_frames, axis=0, ignore_index=True)
writer = pd.ExcelWriter(output_file)
all_data_concatenated.to_excel(writer, sheet_name='all_data_all_workbooks', index=False)
writer.save()
스크립트를 실행하려면 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

BPF로 리눅스 관측 가능성 향상하기: 성능 분석과 네트워킹을 위한 고급 프로그래밍

BPF로 리눅스 관측 가능성 향상하기: 성능 분석과 네트워킹을 위한 고급 프로그래밍

류광, 데이비드 칼라베라, 로렌초 폰타나

Publisher Resources

ISBN: 9791162240144