forked from takahiro/analyze_lab_placement_survey
Compare commits
2 Commits
1dce5c8ac0
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5de1073bd5 | |||
| 730b21f73d |
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
@@ -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