Q13. Female Ratio

Q13. Female Ratio#

Question#

What is the percentage of female researchers in your group?

Choices#

The answer is expected in integer between 0 to 100. Fill “-1” if you prefer not to answer.

Responses#

import pandas as pd
import hvplot.pandas
import titanite as ti

print(f"Pandas: {pd.__version__}")
print(f"Titanite: {ti.__version__}")
%opts magic unavailable (pyparsing cannot be imported)
%compositor magic unavailable (pyparsing cannot be imported)
Pandas: 2.2.2
Titanite: 0.5.0
f_cfg = "../../../sandbox/config.toml"
f_csv = "../../../data/test_data/prepared_data.csv"
d = ti.Data(read_from=f_csv, load_from=f_cfg)
config = d.config()
data = d.read()
2024-08-24 23:32:19.433 | INFO     | titanite.preprocess:categorical_data:125 - Categorize
data.hvplot.hist(
    "q13",
    bins=105,
    bin_range=(-5, 100),
    title="Q13. Female Ratio in Group",
    xlabel="Percentage",
    ylabel="Entries",
    width=600,
    height=400,
    grid=True,
)

q13を5%刻みのビンにくぎりたい

grouped = pd.cut(data["q13"], bins=10).value_counts(sort=False).reset_index()
grouped
# grouped.hvplot.scatter(x="q13", y="count")
# grouped.hvplot.bar(x="q13_binned", y="count", grid=True)
q13 count
0 (-1.101, 9.1] 42
1 (9.1, 19.2] 44
2 (19.2, 29.3] 82
3 (29.3, 39.4] 58
4 (39.4, 49.5] 27
5 (49.5, 59.6] 26
6 (59.6, 69.7] 9
7 (69.7, 79.8] 4
8 (79.8, 89.9] 2
9 (89.9, 100.0] 1