You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
################################################### GRIDKEY MAIN CODE WIP
1141
+
1142
+
#if gridkey_rows is None, skip everything here
1143
+
ifgridkey_rowsisnotNone:
1144
+
1145
+
# Raise error if there are more than 2 items in any idx and gridkey_merge_pairs is True and is_paired is not None
1146
+
ifgridkey_merge_pairsisTrueandis_pairedisnotNone:
1147
+
foriinidx:
1148
+
iflen(i) >2:
1149
+
warnings.warn("gridkey_merge_pairs=True only works if all idx in tuples have only two items. gridkey_merge_pairs has automatically been set to False")
1150
+
gridkey_merge_pairs=False
1151
+
break
1152
+
elifgridkey_merge_pairsisTrueandis_pairedisNone:
1153
+
warnings.warn("gridkey_merge_pairs=True is only applicable for paired data.")
1154
+
gridkey_merge_pairs=False
1155
+
1156
+
# Checks for gridkey_merge_pairs and is_paired; if both are true, "merges" the gridkey per pair
1157
+
ifgridkey_merge_pairsisTrueandis_pairedisnotNone:
1158
+
groups_for_gridkey= []
1159
+
foriinidx:
1160
+
groups_for_gridkey.append(i[1])
1161
+
else:
1162
+
groups_for_gridkey=all_plot_groups
1163
+
1164
+
1165
+
# raise errors if gridkey_rows is not a list, or if the list is empty
1166
+
ifisinstance(gridkey_rows, list) isFalse:
1167
+
raiseTypeError("gridkey_rows must be a list.")
1168
+
eliflen(gridkey_rows) ==0:
1169
+
raiseValueError("gridkey_rows cannot be an empty list.")
1170
+
1171
+
1172
+
# raise Warning if an item in gridkey_rows is not contained in any idx
1173
+
foriingridkey_rows:
1174
+
in_idx=0
1175
+
forjingroups_for_gridkey:
1176
+
ifiinj:
1177
+
in_idx+=1
1178
+
ifin_idx==0:
1179
+
ifis_pairedisnotNone:
1180
+
warnings.warn(i+" is not in any idx. Please check. Alternatively, merging gridkey pairs may not be suitable for your data; try passing gridkey_merge_pairs=False.")
1181
+
else:
1182
+
warnings.warn(i+" is not in any idx. Please check.")
1183
+
1184
+
1185
+
# Populate table: checks if idx for each column contains rowlabel name
1186
+
# IF so, marks that element as present w black dot, or space if not present
1187
+
table_cellcols= []
1188
+
foriingridkey_rows:
1189
+
thisrow= []
1190
+
forqingroups_for_gridkey:
1191
+
ifstr(i) inq:
1192
+
thisrow.append(u"\u25CF")
1193
+
else:
1194
+
thisrow.append("")
1195
+
table_cellcols.append(thisrow)
1196
+
1197
+
1198
+
# Adds a row for Ns with the Ns values
1199
+
ifgridkey_show_Ns==True:
1200
+
gridkey_rows.append("Ns")
1201
+
list_of_Ns= []
1202
+
foriingroups_for_gridkey:
1203
+
list_of_Ns.append(str(counts.loc[i]))
1204
+
table_cellcols.append(list_of_Ns)
1205
+
1206
+
1207
+
# Adds a row for effectsizes with effectsize values
1208
+
ifgridkey_show_es==True:
1209
+
gridkey_rows.append(u"\u0394")
1210
+
effsize_list= []
1211
+
results_list=results.test.to_list()
1212
+
1213
+
# get the effect size, append + or -, 2 dec places
0 commit comments