Howdy, Stranger!

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

Supported by

"Segmentation" of eye-tracking data in Python (e.g. pandas)

Hi all,

A more general question from me this time. I typically used OpenSesame to present my stimuli whilst using the eye tracker (usually Tobii Glasses or, like this time, the SMI red-500). In my current experiment, I am sending string messages to the eye tracker at the start of each trial (numbered), at the onset of the stimulus of interest, and at its offset.*

One thing that I've never managed to do in the most efficient way possible is selecting all the data in the dataframe for each trial between (and including) the two messages. Then, I could simply run aggregate functions on each period of interest (e.g. total dwell time on an AOI) and merge it with the OS output fur further data processing.

I was thinking of using the .loc function in Pandas. However, what I find the most tricky with something like Pandas compared to, say, Matlab, is iterating through the dataframe (I.e. "find the next instance and index it, then find the next instance and index it, then ... etc." instead of "find all and aggregate", if that explanation makes sense.

I am asking here first rather than on Stack Overflow, because this type of data is quite common in psych experiments. In short, just wondering if there's anyone who used Python to process similar data, and/or whether I am missing something obvious.

  • PS @eduard, if you're reading along - According to your script, this function is not supported in SMI, but there is an easy solution. Remind me to commit to you Git. :)


  • (I can't find an edit button. The post scriptum was meant for @Edwin. Bloody auto-fill...)

  • Hi Cesco,

    I wouldn't say that there's a standard way to do this, and the initial parsing process (i.e. going from the text data to some Python data structure) always depends on the specifics of the eye tracker. However, perhaps this tutorial (for EyeLink data) will give you some idea of how you could do this.



    Buy Me A Coffee

  • Hi @sebastiaan,

    I had a quick look at the eyelinkparser (and the included smiparser) and it looks VERY useful indeed, thanks!

  • Good to hear! I should say, though, that I developed the EyeLinkParser mostly for internal use, so it's not documented very well. And that's even more true of the SMIParser, which I believe has only ever been used by @intanwardhani.

    Buy Me A Coffee

  • Just to wrap up this discussion, I'm actually using a custom parser that outputs a pandas compatible (uniform) .csv. I do like how DataMatrix works with both categorical and series data, but I'm sticking to pandas for now because of familiarity and a tight conference paper deadline. :)

    To answer my own iteration question, itertuples() works quite well. The selection of relevant phases is quite straight-forward too as I can just slice the whole Dataframe per trial, get the indices of the relevant messages, and use the range between these indices.

    Bottom line: all is well.

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 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