Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:17:10+00:00 2026-05-22T18:17:10+00:00

I need to merge data from 2 different sources . The tables below illustrate

  • 0

I need to merge data from 2 different sources. The tables below illustrate what I have :

enter image description here

And the desired Output :

enter image description here

The idea is:

  • Look into the first col. of Table1 (TrialNO)

  • Look for it in the first col. of Table2.

  • Check that the values in the second col. are equal
    (in reality those col. won’t be located at the same locations in the 2 lists)

  • If Check is pass append the values located in col. 3 & 4 (Cond1 & Cond2) to the line in Table2.

  • I don’t think I will keep the headers in the real structure, so it should not represent an additional problem, but suggestions to deal with headers are welcome (whether to remove them and store them somewhere else or treat them in a special way)

**

EDIT : Giving precision on the shape of my data & my goals

**

I will give a little background on how I get those data to clarify its shape. I am sure it could be described technically in more accurate way. Please don`t hesitate to correct me.

I am recording eye-movements (saccades & fixations) and subjects answer to a task while displaying stimuli on a screen on.

  • Each Trial consist of two consecutive displays of 3 seconds each. It is a 2AFC (Two-alternative forced choice).
  • Each display consist of presenting a frame (about 1/4 size of the screen) with 8 shapes in it, displayed on 1 out of 4 quadrants of the screen.
  • There is 5 conditions of what the frame itself is made of and thus 10 conditions possible for each trial (1 condition of frame against another without repetition).
  • There are 2 measures : The choice of the subject & the eye-movements recorded while looking at the stimuli.

I get those data from 2 different sources :


  • The “display” machine which provide

-Trial number/Display number

-Informations about the screen

-Conditions

-Subject Answer

-X & Y coordinate as well as size of the 11 object composing the stimuli displayed.

In this Matrix, each row is a Display so the DisplayNO Column Would go from 1 to 400 (1,2,3,4,…,400) while the TrialNO Columns actually goes from 1 to 200 (1,1,2,2,..,200,200)
since there is 2 displays per trial.


  • The “Eye-Tracking” machine which provides :

-Some similar info (Display number (1to 400), that will be used to merge the 2, condition number, that can be uses to check the mapping bet. the 2)

Then a massive amount of variables describing the eye-movements :

-Fixations and saccades durations, locations, timing etc. (about 100 columns)

In this Matrix, each row is a fixation. The saccade characteristics are then given in columns (previous and next saccade) And there can be from 1 to 30-50 fixations for each display. As a result, I could have 19 rows of data for the first display and 5 for the second.


  • The first step is to merge the 2 the 2 data structure to obtain a big one with each rows corresponding to a fixation.

  • Will have to do this for every subject then aggregate the subjects data on top of each other.

This is my plan to deal with this monster afterward (And this will explain my needs in the other questions) :

  • Extract the Header & columns number.

  • Present them by group in nice table form
    -General Info (Trial ID, Condition, Subject ID…),
    -Display Info (coordinates of objects on screen),
    -Fixations info etc…

  • Have for each of this variabe a summary of the data type (String, Number, text), the range, how many different values the columns takes and some basic descriptive statistics.

  • A system to extract parts of this set conditionally (For Example : Extract the condition number, fixations durations, for chosen display by a particular subject)
    That way I extract some well defined table I then run my analysis on without touching the original data.

If I used my precise situation to present my problem I believe, this could yield to a nice efficient and graphically easy to use tool to deal with a lot of data set in general.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:17:11+00:00Added an answer on May 22, 2026 at 6:17 pm

    I await a more detailed description of your data for better optimization.

    checkMerge[src_, trg_, si_, ti_, sp_] :=
     Module[{rls, ext},
      rls = #[[si]] -> #[[sp]] & /@ src;
      AppendTo[rls, _ -> {,}];
      ext = Replace[trg[[All, ti]], Dispatch@rls, 1];
      ArrayFlatten[{{trg, ext}}]
     ]
    

    The syntax is:

    • src = “source” list (data1)
    • trg = “target” list (data2)
    • si = list of indexes from source to compare
    • ti = list of indexes from target to compare
    • sp = list of indexes from source to append to target

    For your example, this would be:

    checkMerge[data1, data2, {1,2}, {1,2}, {3,4}]
    

    I had to guess the level of changes to accommodate from:

    (in reality those col. won’t be located at the same locations in the 2 lists)

    Therefore, this may have too much or too little specificity.

    1. At present sp must be a list of two indexes (column numbers) just because that made things a little simpler, and I am not sure what you want. Do you want to specify which elements are taken from data1 and appended to data2, or should it be all elements after the compared ones, or something else?

    2. If there are standard values for si, ti, sp, defaults can be added so that you may omit these, unless different values are required.

    3. I assumed that it was okay to extend the rows that do not match with Null to create a rectangular array; these could be deleted afterward to produce a ragged array, if that is your desire.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to merge data from 2 tables into a third (all having the
I have two datasets each with one data table pulled from different sources and
I have some C#/Linq code used to merge data from excel file into db,
We have MYSQL table of MERGE Storage Engine which merges data from 40 tables
I have huge number of Word files I need to merge (join) into one
I have imported data relating to about 70 human subjects from three data tables
I have 2 sets of data from different systems. About 20,000 records a piece.
I need to constantly merge (upsert/delete) data from an ODBC data source to a
I need to merge two SELECT statements. There are two tables in my database,
I need to merge between dev and master frequently. I also have a commit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.