boris-behav-obs 9.6__py2.py3-none-any.whl → 9.6.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boris/analysis_plugins/number_of_occurences_by_independent_variable.py +35 -15
- boris/version.py +2 -2
- {boris_behav_obs-9.6.dist-info → boris_behav_obs-9.6.1.dist-info}/METADATA +1 -1
- {boris_behav_obs-9.6.dist-info → boris_behav_obs-9.6.1.dist-info}/RECORD +8 -8
- {boris_behav_obs-9.6.dist-info → boris_behav_obs-9.6.1.dist-info}/WHEEL +0 -0
- {boris_behav_obs-9.6.dist-info → boris_behav_obs-9.6.1.dist-info}/entry_points.txt +0 -0
- {boris_behav_obs-9.6.dist-info → boris_behav_obs-9.6.1.dist-info}/licenses/LICENSE.TXT +0 -0
- {boris_behav_obs-9.6.dist-info → boris_behav_obs-9.6.1.dist-info}/top_level.txt +0 -0
|
@@ -6,8 +6,8 @@ number of occurences of behaviors by independent_variable
|
|
|
6
6
|
|
|
7
7
|
import pandas as pd
|
|
8
8
|
|
|
9
|
-
__version__ = "0.
|
|
10
|
-
__version_date__ = "2025-
|
|
9
|
+
__version__ = "0.4.0"
|
|
10
|
+
__version_date__ = "2025-07-17"
|
|
11
11
|
__plugin_name__ = "Number of occurences of behaviors by subject by independent_variable"
|
|
12
12
|
__author__ = "Olivier Friard - University of Torino - Italy"
|
|
13
13
|
|
|
@@ -19,16 +19,36 @@ def run(df: pd.DataFrame):
|
|
|
19
19
|
This plugin returns a Pandas dataframe
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
df_results_list: list = []
|
|
23
|
+
|
|
24
|
+
flag_variable_found = False
|
|
25
|
+
|
|
26
|
+
for column in df.columns:
|
|
27
|
+
if isinstance(column, tuple) or (isinstance(column, str) and not column.startswith("independent variable '")):
|
|
28
|
+
continue
|
|
29
|
+
|
|
30
|
+
flag_variable_found = True
|
|
31
|
+
grouped_df: df.DataFrame = (
|
|
32
|
+
df.groupby(
|
|
33
|
+
[
|
|
34
|
+
column,
|
|
35
|
+
"Subject",
|
|
36
|
+
"Behavior",
|
|
37
|
+
]
|
|
38
|
+
)["Behavior"]
|
|
39
|
+
.count()
|
|
40
|
+
.reset_index(name="number of occurences")
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
grouped_df.rename(columns={column: "Value"}, inplace=True)
|
|
44
|
+
|
|
45
|
+
grouped_df.insert(0, "independent variable name", column)
|
|
46
|
+
|
|
47
|
+
df_results_list.append(grouped_df)
|
|
48
|
+
|
|
49
|
+
df_results = pd.concat(df_results_list, ignore_index=True) if df_results_list else pd.DataFrame([])
|
|
50
|
+
|
|
51
|
+
if not flag_variable_found:
|
|
52
|
+
return "No independent variable found"
|
|
53
|
+
else:
|
|
54
|
+
return df_results
|
boris/version.py
CHANGED
|
@@ -78,7 +78,7 @@ boris/time_budget_functions.py,sha256=y5He8crz0xsTxVfz0jATwFFQVnPAIrNHja_0sF6NtR
|
|
|
78
78
|
boris/time_budget_widget.py,sha256=z-tyITBtIz-KH1H2OdMB5a8x9QQLK7Wu96-zkC6NVDA,43213
|
|
79
79
|
boris/transitions.py,sha256=_aZJfJWv3EBrtmQ7qsdTCayQo6uWU7BXqtQQgflEhr4,12250
|
|
80
80
|
boris/utilities.py,sha256=dD5HpojqlAGLVkr3YnOsaqfbCMHFYroe040ZchB5WnM,56662
|
|
81
|
-
boris/version.py,sha256=
|
|
81
|
+
boris/version.py,sha256=mDyPxZPO9ciCvBjRw2xZTdaF3TgIW_KL2omBeJ1TGTo,787
|
|
82
82
|
boris/video_equalizer.py,sha256=FartoGghFK-T53zklP70rPKYqTuzL8qdvfGlsOF2wwc,5854
|
|
83
83
|
boris/video_equalizer_ui.py,sha256=1CG3s79eM4JAbaCx3i1ILZXLceb41_gGXlOLNfpBgnw,10142
|
|
84
84
|
boris/video_operations.py,sha256=rXKWndaALaF-yLEPIY_-Z99XRAncZRzRd1sLzwSpbjs,10768
|
|
@@ -89,7 +89,7 @@ boris/analysis_plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
89
89
|
boris/analysis_plugins/_latency.py,sha256=9kCdFDtb5Zdao1xFpioi_exm_IxyGm6RlY3Opn6GUFo,2030
|
|
90
90
|
boris/analysis_plugins/list_of_dataframe_columns.py,sha256=VEiVhxADtyaIKN4JrfFV02TuTAfWhQ60bf1mHVQp27I,437
|
|
91
91
|
boris/analysis_plugins/number_of_occurences.py,sha256=IDyDrdezqvSKT3BlD8QWpSYk8X9nnBBLI80OUnFJ3bY,509
|
|
92
|
-
boris/analysis_plugins/number_of_occurences_by_independent_variable.py,sha256=
|
|
92
|
+
boris/analysis_plugins/number_of_occurences_by_independent_variable.py,sha256=_7HTKXsyxNfyO69tP8zkQEHzT0C7qHdL1sqBjnUfRQY,1459
|
|
93
93
|
boris/analysis_plugins/time_budget.py,sha256=C1wNYwd5Jugr8h5z2aXRUBY8dF8pD4n953dPwNHY5VY,2244
|
|
94
94
|
boris/portion/__init__.py,sha256=ZBUG4I7YWhRkeWdP-JEpxhxldJlUYQkeaJseTjdhtJE,602
|
|
95
95
|
boris/portion/const.py,sha256=hEp26BKcEg1Js4DfZsBHmDtJJts83Tl1HWQ0CNJNwEc,1588
|
|
@@ -97,9 +97,9 @@ boris/portion/dict.py,sha256=SyHxc7PfDw2ufNLFQycwJtzmRfL48rDp4UrM2KN7IWc,11282
|
|
|
97
97
|
boris/portion/func.py,sha256=3TkQtFKLfsqntwd27HSGHceFhnXHmT-EbNMqktElC5Q,2174
|
|
98
98
|
boris/portion/interval.py,sha256=bAdUiJjGeUAPgsBAImwNeviiwfQq5odfhFZccAWzOTA,20299
|
|
99
99
|
boris/portion/io.py,sha256=ppNeRpiLNrocF1yzGeuEUIhYMf2LfsR-cji3d0nmvUs,6371
|
|
100
|
-
boris_behav_obs-9.6.dist-info/licenses/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
101
|
-
boris_behav_obs-9.6.dist-info/METADATA,sha256=
|
|
102
|
-
boris_behav_obs-9.6.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
103
|
-
boris_behav_obs-9.6.dist-info/entry_points.txt,sha256=k__8XvFi4vaA4QFvQehCZjYkKmZH34HSAJI2iYCWrMs,52
|
|
104
|
-
boris_behav_obs-9.6.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
|
|
105
|
-
boris_behav_obs-9.6.dist-info/RECORD,,
|
|
100
|
+
boris_behav_obs-9.6.1.dist-info/licenses/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
101
|
+
boris_behav_obs-9.6.1.dist-info/METADATA,sha256=rOegvZFaLcobCRMuUmpNavzzhWQyX7wdWPrEs7ahGpY,4602
|
|
102
|
+
boris_behav_obs-9.6.1.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
103
|
+
boris_behav_obs-9.6.1.dist-info/entry_points.txt,sha256=k__8XvFi4vaA4QFvQehCZjYkKmZH34HSAJI2iYCWrMs,52
|
|
104
|
+
boris_behav_obs-9.6.1.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
|
|
105
|
+
boris_behav_obs-9.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|