Alexander commited on
Commit
83ff50e
·
1 Parent(s): 561cf94

transpose table to allow arrow serialization

Browse files
Files changed (1) hide show
  1. src/app.py +12 -11
src/app.py CHANGED
@@ -502,26 +502,27 @@ sim_output_2 = simulator(
502
  random_state=randomseed_2,
503
  )
504
 
505
- # Make metadata dataframe
506
- # AF-TODO: Should be transposed and then resolve consequences
507
- # because right now the dataframe has mixed data types in each columns
508
- # which leads streamlit to complain about arrow incompatibility
509
  metadata = pd.DataFrame(
510
  {
511
- "Model 1": [
512
  str(sim_output_1["metadata"]["model"]),
513
- float(sim_output_1["choice_p"][0, 0]),
514
- float(sim_output_1["rts"].mean()),
515
- float(sim_output_1["metadata"]["s"]),
516
- ],
517
- "Model 2": [
518
  str(sim_output_2["metadata"]["model"]),
 
 
 
519
  float(sim_output_2["choice_p"][0, 0]),
 
 
 
520
  float(sim_output_2["rts"].mean()),
 
 
 
521
  float(sim_output_2["metadata"]["s"]),
522
  ],
523
  },
524
- index=["Model", "Choice Probability", "Mean RT", "Noise SD"],
525
  )
526
 
527
  col3, col4 = st.columns(2)
 
502
  random_state=randomseed_2,
503
  )
504
 
505
+ # Make metadata dataframes
 
 
 
506
  metadata = pd.DataFrame(
507
  {
508
+ "Model": [
509
  str(sim_output_1["metadata"]["model"]),
 
 
 
 
 
510
  str(sim_output_2["metadata"]["model"]),
511
+ ],
512
+ "Choice Probability": [
513
+ float(sim_output_1["choice_p"][0, 0]),
514
  float(sim_output_2["choice_p"][0, 0]),
515
+ ],
516
+ "Mean RT": [
517
+ float(sim_output_1["rts"].mean()),
518
  float(sim_output_2["rts"].mean()),
519
+ ],
520
+ "Noise SD": [
521
+ float(sim_output_1["metadata"]["s"]),
522
  float(sim_output_2["metadata"]["s"]),
523
  ],
524
  },
525
+ index=["Model 1", "Model 2"],
526
  )
527
 
528
  col3, col4 = st.columns(2)