# Visual behaviour and 2P data set rewards

**URL:** <https://community.brain-map.org/t/visual-behaviour-and-2p-data-set-rewards/1199>\
**Category:** Science\
**Tags:** behavior, experiment-design, brain-observatory-visual-behavior\
**Created:** [July 22, 2021, 1:23am UTC](https://community.brain-map.org/t/visual-behaviour-and-2p-data-set-rewards/1199 "2021-07-22T01:23:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tristan.j.philippe](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tristan.j.philippe](https://community.brain-map.org/u/Tristan.j.philippe)\
**Post date:** [July 22, 2021, 1:23am UTC](https://community.brain-map.org/t/visual-behaviour-and-2p-data-set-rewards/1199/1 "2021-07-22T01:23:02Z")

</div>

Hi,

I would like to get whether an animal was rewarded or not per image presentation from the SDK datasets but cannot find it. There is a ‘insertsession’.rewards file but it’s of length 70 instead of ~4400 or the number of image presentations.

Thanks!  
Tristan

---

<div class="post-metadata">

**Author:** ![marinag](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/marinag/32/21_2.png) [@marinag](https://community.brain-map.org/u/marinag)\
**Post date:** [July 22, 2021, 1:58am UTC](https://community.brain-map.org/t/visual-behaviour-and-2p-data-set-rewards/1199/2 "2021-07-22T01:58:47Z")

</div>

Hi Tristan,

The `rewards` dataframe contains the timestamps of each reward that occurred during the session. To associate the rewards with each image presentation, you have to do a little bit of translation between the two dataframes to find the reward times that fall between each image presentation start and end time.

I’ve made an example jupyter notebook [here](https://gist.github.com/matchings/846e7633d57501b5af55f4daae22a4d9) that shows how to do this.

-Marina
