Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Create Two Identical Lists

Hi everyone,
I'm trying to implement an easy recognition memory experiment with a learning phase and a recalling phase. So I need 2 lists of stimuli that are identical. They should contain the name of the stimulus (stimName) and the category (reconCateg).
To do this I implemented an in_line script at the beginning that creates a list (reconCateg ), shuffles the category variable and copies the list in two separate lists (reconCategLearningGlobal, reconCategReconGlobal).

from random import shuffle #import shuffle

var.reconCateg = [1, 1, 0, 0] #create category list
var.reconCateg = list(var.reconCateg) #coerce to list

#create stimuli list
var.stimName = ["WM-004", "WM-006", "WM-222", "WM-252"]
#shuffle category list
var.reconCateg = shuffle(var.reconCateg)
#copy category list for learning phase
var.reconCategLearningGlobal = list(var.reconCateg)
#copy category list for recognition phase
var.reconCategReconGlobal = list(var.reconCateg)

Subsequently, only stimuli that are not distractors (value 1 in reconCateg) are displayed in the learning phase while all stimuli of the second list are displayed in the recognition phase.

To import the lists to be used in each phase I used another in_line script (one for each phase)

#import the last item of the list for each iteration
var.reconCategLearning = var.reconCategLearningGlobal.pop()

Now I have this error:
'NoneType' object is not iterable
in the in_line script at the beginning. I think it is due to coercing reconCateg to a list, that I need to do to avoid getting the "has no pop attribute" error in the second in_line.

Have you any idea about how to resolve this issue? Or any suggestion to run an experiment as simple as this?
Thanks a lot!!

marco

Comments

  • Hi Marco.

    random.shuffle() doesn't return anything. Instead of doing var.reconCateg = shuffle(var.reconCateg), just do shuffle(var.reconCateg). Does that already solve it?

    Eduard

    Buy Me A Coffee

  • Hi Eduard,
    actually works but now it executes only one iteration of each cycle.
    Do you think it has something to do with .pop()?

    var.reconCategLearning = var.reconCategLearningGlobal.pop()
    

    Maybe I have to copy the whole list? Isn't the in_line inside a loop executed each time?
    Thanks for your help!

    marco

  • How did you set up your loop? Could you quickly upload your experiment? Then I can have a look.

    Eduard

    Buy Me A Coffee

  • Here it is!
    I have only 4 stim right now (just for testing the script).
    In the learning phase, just 2 should be presented, while in the recognition phase all 4 should be shown.
    Thanks a lot!!

    marco

  • You have to set the repeat values as well. If they are set to 1, then the sequence will repeat only once, regardless of how long your list is.

    Two more remarks:
    1)

    var.reconCateg = [1, 1, 0, 0] #create category list
    var.reconCateg = list(var.reconCateg) #coerce to list # THIS LINE DOESNT DO ANYTHING
    

    2) Not sure whether it is important but if you shuffle one list, your stimName list won't match the shuffled list anymore. If you want to retain the order, you should nest your lists, e.g. l = [[1ststim,1stimname],[2ndStim, 2ndStimName],etc]

    Good luck

    Eduard

    Buy Me A Coffee

  • So dumb! :D Thanks a loooooot!!

    For the remarks, I don't need to shuffle the stimName because the loops are already randomized and the stimName has the same order for both loops. So the only thing I'm randomizing is the assignment of the stimName to the to-be-learned or the distractor category.

    marco

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games