added charts
This commit is contained in:
parent
fe79db36f0
commit
cb2d7244e8
20 changed files with 485 additions and 28 deletions
23
tools/statistics/analyse/age.py
Normal file
23
tools/statistics/analyse/age.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
from collections import Counter
|
||||||
|
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
ages_data = list(map(extract.age.extract, datas))
|
||||||
|
|
||||||
|
counter = Counter(ages_data)
|
||||||
|
ages_x = list(counter.keys())
|
||||||
|
ages_y = list(counter.values())
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Nombre de personne par âge")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(ages_x, ages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
39
tools/statistics/analyse/completion_per_age.py
Normal file
39
tools/statistics/analyse/completion_per_age.py
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
ages_completion: dict[int, int] = defaultdict(lambda: 0)
|
||||||
|
ages_count: dict[int, int] = defaultdict(lambda: 0)
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
age = extract.age.extract(data)
|
||||||
|
ages_count[age] += 1
|
||||||
|
|
||||||
|
for survey, survey_data in data["surveys"].items():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if extract.mission_completed.extract(data, survey):
|
||||||
|
ages_completion[age] += 1
|
||||||
|
|
||||||
|
ages_x = list(ages_completion.keys())
|
||||||
|
ages_y = (
|
||||||
|
np.array(list(ages_completion.values()))
|
||||||
|
/ np.array(list(ages_count.values()))
|
||||||
|
)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Nombre moyen de mission complété par âge")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(ages_x, ages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
37
tools/statistics/analyse/completion_per_experience.py
Normal file
37
tools/statistics/analyse/completion_per_experience.py
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
experience_completion: dict[str, int] = {"yes": 0, "mixed": 0, "no": 0}
|
||||||
|
experience_count: dict[str, int] = {"yes": 0, "mixed": 0, "no": 0}
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
experience = extract.experience.extract(data)
|
||||||
|
experience_count[experience] += 1
|
||||||
|
|
||||||
|
for survey, survey_data in data["surveys"].items():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if extract.mission_completed.extract(data, survey):
|
||||||
|
experience_completion[experience] += 1
|
||||||
|
|
||||||
|
ages_x = list(experience_completion.keys())
|
||||||
|
ages_y = (
|
||||||
|
np.array(list(experience_completion.values()))
|
||||||
|
/ np.array(list(experience_count.values()))
|
||||||
|
)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Nombre moyen de mission complété par expérience")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(ages_x, ages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
44
tools/statistics/analyse/completion_per_mission.py
Normal file
44
tools/statistics/analyse/completion_per_mission.py
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
completions: dict[str] = {
|
||||||
|
"mission-language": 0,
|
||||||
|
"mission-price": 0,
|
||||||
|
"mission-community-hub": 0,
|
||||||
|
"mission-game-page": 0,
|
||||||
|
"mission-game-dlc": 0,
|
||||||
|
"mission-actuality-new": 0,
|
||||||
|
"mission-profile": 0,
|
||||||
|
"mission-game-discussion": 0,
|
||||||
|
"mission-gift-card": 0,
|
||||||
|
"mission-workshop": 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
# NOTE : séparé avant / après grosse mise à jour pour carte cadeau ?
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
for survey in data["surveys"].keys():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if extract.mission_completed.extract(data, survey):
|
||||||
|
completions[survey] += 1
|
||||||
|
|
||||||
|
completions_x = list(completions.keys())
|
||||||
|
completions_y = list(completions.values())
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Nombre de personne ayant réussi par mission")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(completions_x, completions_y)
|
||||||
|
axes.set_xticks(completions_x)
|
||||||
|
axes.set_xticklabels(completions_x, rotation=45)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
41
tools/statistics/analyse/completion_per_usage.py
Normal file
41
tools/statistics/analyse/completion_per_usage.py
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
usage_completion: dict[str, int] = {"always": 0, "often": 0, "sometime": 0, "rarely": 0, "never": 0}
|
||||||
|
usage_count: dict[str, int] = {"always": 0, "often": 0, "sometime": 0, "rarely": 0, "never": 0}
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
usage = next(filter(
|
||||||
|
lambda it: it[1]["checked"],
|
||||||
|
data["surveys"]["question-usage-steam"]["choices"].items()
|
||||||
|
))[0]
|
||||||
|
|
||||||
|
usage_count[usage] += 1
|
||||||
|
|
||||||
|
for survey in data["surveys"].keys():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if extract.mission_completed.extract(data, survey):
|
||||||
|
usage_completion[usage] += 1
|
||||||
|
|
||||||
|
usages_x = list(usage_completion.keys())
|
||||||
|
usages_y = (
|
||||||
|
np.array(list(usage_completion.values()))
|
||||||
|
/ np.array(list(usage_count.values()))
|
||||||
|
)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Nombre moyen de mission complété par niveau")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(usages_x, usages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
40
tools/statistics/analyse/duration_per_age.py
Normal file
40
tools/statistics/analyse/duration_per_age.py
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
ages_duration: dict[int, int] = defaultdict(lambda: 0)
|
||||||
|
ages_count: dict[int, int] = defaultdict(lambda: 0)
|
||||||
|
|
||||||
|
# TODO: faire des tranches d'âges ?
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
age = extract.age.extract(data)
|
||||||
|
ages_count[age] += 1
|
||||||
|
|
||||||
|
for survey in data["surveys"].keys():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
ages_duration[age] += extract.mission_duration.extract(data, survey)
|
||||||
|
|
||||||
|
ages_x = list(ages_duration.keys())
|
||||||
|
ages_y = (
|
||||||
|
np.array(list(ages_duration.values()))
|
||||||
|
/ np.array(list(ages_count.values()))
|
||||||
|
)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Temps moyen passé par âge")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(ages_x, ages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
37
tools/statistics/analyse/duration_per_experience.py
Normal file
37
tools/statistics/analyse/duration_per_experience.py
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
experience_duration: dict[str, int] = {"yes": 0, "mixed": 0, "no": 0}
|
||||||
|
experience_count: dict[str, int] = {"yes": 0, "mixed": 0, "no": 0}
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
experience = extract.experience.extract(data)
|
||||||
|
experience_count[experience] += 1
|
||||||
|
|
||||||
|
for survey, survey_data in data["surveys"].items():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if extract.mission_completed.extract(data, survey):
|
||||||
|
experience_duration[experience] += extract.mission_duration.extract(data, survey)
|
||||||
|
|
||||||
|
ages_x = list(experience_duration.keys())
|
||||||
|
ages_y = (
|
||||||
|
np.array(list(experience_duration.values()))
|
||||||
|
/ np.array(list(experience_count.values()))
|
||||||
|
)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Temps moyen passé par expérience")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(ages_x, ages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
45
tools/statistics/analyse/duration_per_mission.py
Normal file
45
tools/statistics/analyse/duration_per_mission.py
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
durations: dict[str] = {
|
||||||
|
"mission-language": 0,
|
||||||
|
"mission-price": 0,
|
||||||
|
"mission-community-hub": 0,
|
||||||
|
"mission-game-page": 0,
|
||||||
|
"mission-game-dlc": 0,
|
||||||
|
"mission-actuality-new": 0,
|
||||||
|
"mission-profile": 0,
|
||||||
|
"mission-game-discussion": 0,
|
||||||
|
"mission-gift-card": 0,
|
||||||
|
"mission-workshop": 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
# NOTE : séparé avant / après grosse mise à jour pour carte cadeau ?
|
||||||
|
# NOTE : marqué en rouge la durée d'abandon ?
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
for survey in data["surveys"].keys():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
durations[survey] += extract.mission_duration.extract(data, survey)
|
||||||
|
|
||||||
|
durations_x = list(durations.keys())
|
||||||
|
durations_y = np.array(list(durations.values())) / len(datas)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Temps moyen passé par test")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(durations_x, durations_y)
|
||||||
|
axes.set_xticks(durations_x)
|
||||||
|
axes.set_xticklabels(durations_x, rotation=45)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
38
tools/statistics/analyse/duration_per_usage.py
Normal file
38
tools/statistics/analyse/duration_per_usage.py
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
usage_completion: dict[str, int] = {"always": 0, "often": 0, "sometime": 0, "rarely": 0, "never": 0}
|
||||||
|
usage_count: dict[str, int] = {"always": 0, "often": 0, "sometime": 0, "rarely": 0, "never": 0}
|
||||||
|
|
||||||
|
# TODO: faire des tranches d'âges ?
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
usage = extract.usage.extract(data)
|
||||||
|
usage_count[usage] += 1
|
||||||
|
|
||||||
|
for survey in data["surveys"].keys():
|
||||||
|
# only scan survey mission
|
||||||
|
if not survey.startswith("mission-"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
usage_completion[usage] += extract.mission_duration.extract(data, survey)
|
||||||
|
|
||||||
|
ages_x = list(usage_completion.keys())
|
||||||
|
ages_y = (
|
||||||
|
np.array(list(usage_completion.values()))
|
||||||
|
/ np.array(list(usage_count.values()))
|
||||||
|
)
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Temps moyen passé par niveau")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(ages_x, ages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
26
tools/statistics/analyse/experience.py
Normal file
26
tools/statistics/analyse/experience.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
from collections import Counter
|
||||||
|
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
experiences: dict[str, int] = {"yes": 0, "mixed": 0, "no": 0}
|
||||||
|
for data in datas:
|
||||||
|
experience = extract.experience.extract(data)
|
||||||
|
experiences[experience] += 1
|
||||||
|
|
||||||
|
counter = Counter(experiences)
|
||||||
|
x = list(counter.keys())
|
||||||
|
y = list(counter.values())
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Nombre de personne par expérience")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(x, y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
36
tools/statistics/analyse/hardest_mission.py
Normal file
36
tools/statistics/analyse/hardest_mission.py
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
missions = {
|
||||||
|
"mission-language": 0,
|
||||||
|
"mission-price": 0,
|
||||||
|
"mission-community-hub": 0,
|
||||||
|
"mission-game-page": 0,
|
||||||
|
"mission-game-dlc": 0,
|
||||||
|
"mission-actuality-new": 0,
|
||||||
|
"mission-profile": 0,
|
||||||
|
"mission-game-discussion": 0,
|
||||||
|
"mission-gift-card": 0,
|
||||||
|
"mission-workshop": 0
|
||||||
|
}
|
||||||
|
|
||||||
|
for data in datas:
|
||||||
|
missions[extract.hardest_mission.extract(data)] += 1
|
||||||
|
|
||||||
|
x = list(missions.keys())
|
||||||
|
y = list(missions.values())
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Mission la plus difficile des personnes sondées")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(x, y)
|
||||||
|
axes.set_xticks(x)
|
||||||
|
axes.set_xticklabels(x, rotation=45)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
24
tools/statistics/analyse/usage.py
Normal file
24
tools/statistics/analyse/usage.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from tools.statistics import extract
|
||||||
|
|
||||||
|
|
||||||
|
def analyse(datas: list[dict]):
|
||||||
|
usage_data = list(map(extract.usage.extract, datas))
|
||||||
|
|
||||||
|
usages: dict[str, int] = {"always": 0, "often": 0, "sometime": 0, "rarely": 0, "never": 0}
|
||||||
|
for usage in usage_data:
|
||||||
|
usages[usage] += 1
|
||||||
|
|
||||||
|
usages_x = list(usages.keys())
|
||||||
|
usages_y = list(usages.values())
|
||||||
|
|
||||||
|
# prepare plotting
|
||||||
|
figure: plt.Figure = plt.figure()
|
||||||
|
axes = figure.add_subplot(1, 1, 1)
|
||||||
|
axes.set_title("Expérience des personnes sondées")
|
||||||
|
|
||||||
|
# bar chart
|
||||||
|
axes.bar(usages_x, usages_y)
|
||||||
|
|
||||||
|
plt.show(block=True)
|
6
tools/statistics/extract/__init__.py
Normal file
6
tools/statistics/extract/__init__.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
from . import usage
|
||||||
|
from . import age
|
||||||
|
from . import mission_duration
|
||||||
|
from . import mission_completed
|
||||||
|
from . import experience
|
||||||
|
from . import hardest_mission
|
2
tools/statistics/extract/age.py
Normal file
2
tools/statistics/extract/age.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
def extract(data: dict) -> int:
|
||||||
|
return data["surveys"]["question-age"]["value"]
|
5
tools/statistics/extract/experience.py
Normal file
5
tools/statistics/extract/experience.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
def extract(data: dict) -> str:
|
||||||
|
return next(filter(
|
||||||
|
lambda it: it[1]["checked"],
|
||||||
|
data["surveys"]["question-experience"]["choices"].items()
|
||||||
|
))[0]
|
5
tools/statistics/extract/hardest_mission.py
Normal file
5
tools/statistics/extract/hardest_mission.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
def extract(data: dict) -> str:
|
||||||
|
return next(filter(
|
||||||
|
lambda it: it[1]["checked"],
|
||||||
|
data["surveys"]["question-hardest-mission"]["choices"].items()
|
||||||
|
))[0]
|
9
tools/statistics/extract/mission_completed.py
Normal file
9
tools/statistics/extract/mission_completed.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
def extract(data: dict, mission: str) -> bool:
|
||||||
|
events = data["surveys"][mission]["event"]
|
||||||
|
|
||||||
|
try:
|
||||||
|
checks = next(filter(lambda event: event["type"] == "check", events))
|
||||||
|
except StopIteration:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
2
tools/statistics/extract/mission_duration.py
Normal file
2
tools/statistics/extract/mission_duration.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
def extract(data: dict, mission: str) -> float:
|
||||||
|
return data["surveys"][mission]["event"][-1]["time"]
|
5
tools/statistics/extract/usage.py
Normal file
5
tools/statistics/extract/usage.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
def extract(data: dict) -> str:
|
||||||
|
return next(filter(
|
||||||
|
lambda it: it[1]["checked"],
|
||||||
|
data["surveys"]["question-usage-steam"]["choices"].items()
|
||||||
|
))[0]
|
|
@ -1,38 +1,31 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from tools.statistics.analyse import (age, usage, completion_per_mission, duration_per_mission, completion_per_age,
|
||||||
|
completion_per_usage, duration_per_age, duration_per_usage,
|
||||||
|
completion_per_experience, duration_per_experience, experience, hardest_mission)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from source.utils import compress
|
from source.utils import compress
|
||||||
|
|
||||||
directory = Path(r"C:\Users\RC606\Downloads\résultats étude")
|
directory = Path(r"./sondage/")
|
||||||
|
|
||||||
# read every people survey data
|
# read every people survey data
|
||||||
for file in directory.rglob("*.rsl"):
|
datas = [
|
||||||
# decompress the data
|
compress.uncompress_data(file.read_bytes()) # decompress the data
|
||||||
data = compress.uncompress_data(file.read_bytes())
|
for file in directory.rglob("*.rsl")
|
||||||
|
]
|
||||||
|
|
||||||
|
# age.analyse(datas)
|
||||||
|
# usage.analyse(datas)
|
||||||
|
# experience.analyse(datas)
|
||||||
|
# hardest_mission.analyse(datas) # !
|
||||||
|
|
||||||
|
# completion_per_mission.analyse(datas)
|
||||||
|
# completion_per_age.analyse(datas)
|
||||||
|
# completion_per_usage.analyse(datas) # !
|
||||||
|
# completion_per_experience.analyse(datas)
|
||||||
|
|
||||||
|
# duration_per_mission.analyse(datas)
|
||||||
ages = sorted(list(map(
|
# duration_per_age.analyse(datas)
|
||||||
lambda data: data["surveys"]["question-age"]["value"],
|
# duration_per_usage.analyse(datas) # !
|
||||||
datas
|
# duration_per_experience.analyse(datas) # !
|
||||||
)))
|
|
||||||
|
|
||||||
print(ages)
|
|
||||||
print(sum(ages) / len(ages))
|
|
||||||
print(ages[len(ages) // 2])
|
|
||||||
print(min(ages))
|
|
||||||
print(max(ages))
|
|
||||||
|
|
||||||
print(datas[1]["surveys"]["question-usage-steam"])
|
|
||||||
|
|
||||||
usages = sorted(list(map(
|
|
||||||
lambda data: data["surveys"]["question-usage-steam"]["choices"],
|
|
||||||
datas
|
|
||||||
)))
|
|
||||||
|
|
||||||
print(usages)
|
|
||||||
print(sum(usages) / len(usages))
|
|
||||||
print(usages[len(usages) // 2])
|
|
||||||
print(min(usages))
|
|
||||||
print(max(usages))
|
|
||||||
|
|
Loading…
Reference in a new issue