2
2

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 5 years have passed since last update.

Jupyter Notebookを用いて、同フォーマットの異なるデータにおけるhtml分析レポートを自動出力する

Last updated at Posted at 2018-03-13

アウトラインメモです。時間があるときに詳細を書くつもり。

概要

  • 同フォーマットで複数ある異なる種類のデータに対して、Jupiter Notebookで分析レポートを自動で作成できるようにする。
  • 例えば、為替レート(USD/JPY,GBP/JPY...)のような時系列データにおいて、チャートや基礎統計量等、各種指標を見れるようなレポートをそれぞれのレートで自動的に作成したい場合。

背景

  • データを傾向を可視化するのにjupyter notebookを使っていた
  • フォーマットは同じだが異なる種類のデータを可視化したい
  • 可視化のテンプレートを作って、異なるデータに対して出力結果のhtmlを出力したい
  • データ毎にJupyter notebookを実行してhtml出力するのは面倒臭いから自動化したい
  • Jupyter notebookには標準入力のようなものがないので、コマンドライン等から引数を取って表示内容を変更できない

やったこと

  • notebookのテンプレートを作成
  • notebookテンプレートの入力データは必ず指定フォルダの指定ファイルを参照するようにする
  • シェルスクリプトで以下を繰り返す
  1. 指定フォルダのファイルを削除
  2. インプットフォルダからデータを指定フォルダにコピー
  3. nbconvertでnotebookを実行
  4. nbconvertでnotebookをhtml化
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?