両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン |
python:openpyxl [2019/03/04 14:49] – mumeiyamibito | python:openpyxl [2019/03/04 14:51] (現在) – mumeiyamibito |
---|
* ''ws'': ワークシートオブジェクト | * ''ws'': ワークシートオブジェクト |
* ''wb'': ワークブックオブジェクト | * ''wb'': ワークブックオブジェクト |
* ワークシート名で選択<code python>wb["SHEET_NAME"] | * ワークシート名で選択<code python>wb["SHEET_NAME"]</code> |
* ワークシート名の変更<code python>ws.title = "NAME"</code> | * ワークシート名の変更<code python>ws.title = "NAME"</code> |
* ''ws'': ワークシートオブジェクト | * ''ws'': ワークシートオブジェクト |
* 数値 | * 数値 |
* 数値のデフォルト<code python>cell.number_format = openpyxl.styles.numbers.FORMAT_NUMBER</code> | * 数値のデフォルト<code python>cell.number_format = openpyxl.styles.numbers.FORMAT_NUMBER</code> |
* 桁数を指定<code python>cell.number_format = "0.0_" | * 桁数を指定<code python>cell.number_format = "0.0_"</code> |
* ''0_''、''0.0_''、''0.00_'' のように桁数を指定する。 | * ''0_''、''0.0_''、''0.00_'' のように桁数を指定する。 |
* コンマ区切り<code python>cell.number_format = "#,##0.0_" | * コンマ区切り<code python>cell.number_format = "#,##0.0_"</code> |
* 桁数指定の前に ''#,##'' を付ける。 | * 桁数指定の前に ''#,##'' を付ける。 |
* パーセント表示<code python>cell.number_format = "0.0%" | * パーセント表示<code python>cell.number_format = "0.0%"</code> |
* 数値の表記の後に ''%'' を付ける。 | * 数値の表記の後に ''%'' を付ける。 |
| |
* [[https://note.nkmk.me/python-openpyxl-usage/ | PythonでExcelファイル(xlsx)を読み書きするopenpyxlの使い方 | note.nkmk.me]] | * [[https://note.nkmk.me/python-openpyxl-usage/ | PythonでExcelファイル(xlsx)を読み書きするopenpyxlの使い方 | note.nkmk.me]] |
* [[http://note.crohaco.net/2017/python-openpyxl-excel/ | [Python] openpyxl で Excel を操作してみた! - くろのて]] | * [[http://note.crohaco.net/2017/python-openpyxl-excel/ | [Python] openpyxl で Excel を操作してみた! - くろのて]] |
| * [[https://pg-chain.com/python-excel-format | Python Excelのセルにフォーマットを指定する | 鎖プログラム]] |
| |
| |
{{tag>プログラミング}} | {{tag>プログラミング}} |
| |