Help us understand the problem. What is going on with this article?

進捗をgit logとpandasで可視化する

More than 3 years have passed since last update.

背景

そろそろ卒論/修論/博論の季節ですね。
自分の頑張りの可視化をするために、gitで管理しているtexファイルのコミットログをpandasで可視化してみます。

gistにnotebookを置いたので詳しくはそちらを。

ざっくりしたやり方

gitのログの出力

git log --numstat --pretty="%ad" --date=iso *.tex > thesis_log.txt

こんな感じのが出てきます。

2016-01-08 14:16:21 +0900

61      141     masterthesis/method.tex
18      1       masterthesis/thank.tex

DataFrameにする

頑張ってこんな感じにします。
スクリーンショット 2016-12-17 14.38.17.png

集計する

# 日ごとにリサンプリング
per_day = table.unstack().resample("d").sum().stack()

# 日毎の合計
tot = per_day.sum(axis=1).unstack()

# 累計(すなわり、頑張り)
tot["total"] = tot["plus"].cumsum() - tot["minus"].cumsum()

これで頑張りの時系列データが出来ました

オマケ

コミケの原稿の進捗(本当はこれをプロットしたかった)
comike_progress.png

xeno14
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした