1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pythonでExcelを扱う

Posted at

まあこれを見ればよいよ、というだけの話ではあるが。
https://note.nkmk.me/python-pandas-read-excel/

pandasだけではなくて、xlrdもインストールする必要があることに注意。

sample.py
import sys
import pandas as pd 

# 読み込むXLSファイル
excel_file = sys.argv[1]
print('ファイル名⇒', sys.argv[1])


if __name__== '__main__':

	file = pd.ExcelFile(excel_file)

	# "parent"というシートを読み込む
	sheet_df = file.parse("parent")

	for j,series in sheet_df.iterrows():
		
		# 行ごとの処理
		parent_xxx(series)
1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?