I have an experiment that runs very well locally, however when I tried to push it to pavlovia I got the error where it says “intialising experiment” but never continues onto the experiment. I looked the problem up in the discource and found that my experiment uses a lot of code that is not compatible with online experiments (including pandas, etc.) I was wondering if there is any way for me to make this code compatible online. Thank you so much!
Here is an example of my code that is in the code component:
import pandas as pd
from psychopy import data
import os
import json
import random
Read Excel File
file_path = ‘resources/scramble_words_1.xlsx’
df = pd.read_excel(file_path)
Shuffle only ‘facts’ column while keeping ‘scramble’ and ‘unscramble’ columns intact
shuffled_facts = df[‘facts’].sample(frac=1).reset_index(drop=True)
df[‘facts’] = shuffled_facts
Shuffle the rows of the DataFrame to maintain the correspondence between columns
shuffled_indices = list(df.index)
random.shuffle(shuffled_indices)
df = df.iloc[shuffled_indices].reset_index(drop=True)
conditions_list = df.to_dict(orient=‘records’)
#links to loop called trial_2
trials_2 = data.TrialHandler(nReps=len(conditions_list), method=‘random’, seed=None, dataTypes=[‘scramble’, ‘unscramble’, ‘facts’], trialList=conditions_list)