forked from takahiro/analyze_lab_placement_survey
Compare commits
7 Commits
69031cd4db
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5de1073bd5 | |||
| 730b21f73d | |||
| 1dce5c8ac0 | |||
| 906afbc53d | |||
| 4d6a836cbf | |||
| eb43379ce4 | |||
| 83ce11279f |
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
+18
@@ -272,6 +272,24 @@ Excel ファイルには以下のシートを作成します。
|
||||
- 「値 / カウント」表
|
||||
- Google Forms のグラフ由来の連結数字列
|
||||
|
||||
* 可視化例
|
||||
|
||||
解析スクリプトでは、研究室ごとの GP 分布や、特定研究室の希望者が全体の中で
|
||||
どの位置にいるかを確認できます。
|
||||
|
||||
以下は出力図の例です。
|
||||
|
||||
#+CAPTION: GP 分布と第10研究室希望者の位置を示した可視化例
|
||||
#+NAME: fig:gp-distribution
|
||||
[[file:hoge.png]]
|
||||
|
||||
上段では、研究室ごとの GP 分布を箱ひげ図として示しています。
|
||||
各研究室の希望者の GP のばらつきや中央値を比較できます。
|
||||
|
||||
下段では、全回答者の GP 分布をヒストグラムとして示しています。
|
||||
第10研究室希望者の GP は縦線として重ねて表示しており、
|
||||
第10研究室希望者が全体分布の中でどの程度の位置にいるかを確認できます。
|
||||
|
||||
* 注意事項
|
||||
|
||||
- 入力テキストは Google Forms の表示形式に依存します。
|
||||
|
||||
@@ -34,7 +34,8 @@ def extract_values_from_body(body):
|
||||
table_part = body[m.end():]
|
||||
|
||||
count_rows = re.findall(
|
||||
r"^\s*(-?\d+(?:\.\d+)?)\s+(\d+)\s*$", table_part, flags=re.MULTILINE
|
||||
r"^\s*(-?\d+(?:\.\d+)?)\s+(\d+)\s*$", table_part,
|
||||
flags=re.MULTILINE
|
||||
)
|
||||
|
||||
values = []
|
||||
@@ -378,7 +379,8 @@ def annotate_target_values(ax, target_values, color):
|
||||
rotation=90,
|
||||
color=color,
|
||||
fontsize=9,
|
||||
bbox={"facecolor": "white", "edgecolor": "none", "alpha": 0.75, "pad": 1.2},
|
||||
bbox={"facecolor": "white", "edgecolor": "none",
|
||||
"alpha": 0.75, "pad": 1.2},
|
||||
)
|
||||
|
||||
|
||||
@@ -444,7 +446,8 @@ def plot_data(data, lower=10, upper=None, target_lab=10, bin_width=10):
|
||||
|
||||
df = filter_plot_data(df, lower=lower, upper=upper)
|
||||
labs = sorted(df["研究室番号"].unique())
|
||||
target_values = df.loc[df["研究室番号"] == target_lab, "値"].to_numpy(dtype=float)
|
||||
target_values = df.loc[df["研究室番号"] ==
|
||||
target_lab, "値"].to_numpy(dtype=float)
|
||||
|
||||
apply_plot_style()
|
||||
colors = plt.get_cmap("tab10").colors
|
||||
@@ -459,7 +462,8 @@ def plot_data(data, lower=10, upper=None, target_lab=10, bin_width=10):
|
||||
)
|
||||
|
||||
draw_lab_boxplot(axs[0], df, labs, colors[0], rng)
|
||||
draw_gp_histogram(axs[1], df, target_values, bin_width, colors[0], colors[3])
|
||||
draw_gp_histogram(axs[1], df, target_values,
|
||||
bin_width, colors[0], colors[3])
|
||||
|
||||
for ax in axs:
|
||||
style_axis(ax)
|
||||
@@ -467,6 +471,7 @@ def plot_data(data, lower=10, upper=None, target_lab=10, bin_width=10):
|
||||
plt.show()
|
||||
return fig, axs
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Google Forms のコピペ結果から研究室別GPを集計する"
|
||||
@@ -491,7 +496,8 @@ def main():
|
||||
text = f.read()
|
||||
|
||||
df = parse_google_form_results(text)
|
||||
df_r = summarize_by_lab(df).sort_values(by="GP mean", ascending=False)
|
||||
# df_r = summarize_by_lab(df).sort_values(by="GP mean", ascending=False)
|
||||
df_r = summarize_by_lab(df)
|
||||
|
||||
print_summary(df, df_r)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user