Questions tagged [merge]

Merging is a generic term for combining two or more related sets of data. It is commonly associated with revision control systems when reconciling multiple changes made to a revision-controlled collection of files. Merging multiple data sets is another use of this tag.

Most often, it is necessary when a file is modified by two people on two different computers at the same time. When two branches are merged, the result is a single collection of files that contains both sets of changes.

In some cases, the merge can be performed automatically, because the changes do not conflict. In other cases, a person must decide exactly what the resulting files should contain. Many revision control software tools include merge capabilities.

Merge can be used as a verb ("to merge branches"), but can also be a noun ("this merge will be difficult").

Merging multiple data sets is another use of this tag.

Merge can also refer to the Ruby Hash#merge method for merge hashes or git merge command for git revision control system.

Merge is different from join in datasets which is primarily SQL based. Difference between merge and join for SAS is here http://www2.sas.com/proceedings/sugi30/249-30.pdf and for R is here How to join (merge) data frames (inner, outer, left, right)?

See Wikipedia: Merge Version Control.

24925 questions
7
votes
2 answers

Merge on one column or another

I would like to merge 2 dataframes: df1: cik0 cik1 cik2 'MKTG, INC.' 0001019056 None None 1 800 FLOWERS COM INC 0001104659 …
Roger
  • 407
  • 1
  • 4
  • 16
7
votes
3 answers

How to combine two arrays together?

Is there a quick way to combine one arrays values as the other array's keys? Input: array A => Array ( [0] => "cat" [1] => "bat" [2] => "hat" [3] => "mat" ) array B => Array ( [0] => "fur" [1] =>…
Mohammad
  • 7,344
  • 15
  • 48
  • 76
7
votes
1 answer

Git merge, then revert, then revert the revert

So we've gotten a git branch into a tricky state: Two branches: * master * other_branch Last week someone accidentally merged other_branch (prematurely) onto master and pushed to origin. We noticed the error and I, in my naivete, committed git…
Wikiup
  • 325
  • 1
  • 3
  • 10
7
votes
4 answers

Merging 3 linked lists into 1 (Java )

I have a question for a final review for a coding class I am taking. It's asking to merge 3 linked lists into 1 linked list. The problem I am having is when merging the lists I am able to merge the three lists in ascending order but I am missing the…
Daniel Rogers
  • 75
  • 1
  • 7
7
votes
2 answers

Mercurial - basic process to revert a merge and try again

We merge using this process: cd c:\myapp hg pull ssh://hg/myapp-1_0_1 hg merge Now sometimes we mess up the merge or sometimes we get an error (ie: "can't merge file xxx - file in use"). Usually I just delete my c:\myapp repo, re-clone from the…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
7
votes
1 answer

Fastest way to merge two deques

Exist a faster way to merge two deques than this? # a, b are two deques. The maximum length # of a is greater than the current length # of a plus the current length of b while len(b): a.append(b.popleft()) Note that I'm not interested in…
gvgramazio
  • 1,115
  • 3
  • 13
  • 30
7
votes
1 answer

How do I define a .gitattributes rule for a file with spaces in it?

I've read the documentation on .gitattributes and searched Stack Overflow for a simple answer to this question, but so far haven't found it. I have a file with spaces in it like so. Reserved\ Slots.txt merge=mergeslots I have also tried to use…
PatPeter
  • 394
  • 2
  • 17
7
votes
4 answers

Merge list item with previous list item

I'm trying to merge list items with previous items if they don't contain a certain prefix, and adding a \n between said list items when doing so. prefix = '!' cmds = ['!test','hello','world','!echo','!embed','oh god'] output =…
7
votes
3 answers

JavaScript Merge Intersecting Rectangles

I need a way to merge an array of rectangle objects (objects with x,y,w,h properties) only if they intersect. So for example: merge([{x:0, y:0, w:5, h:5}, {x:1, y:1, w:5, h:5}]) would return: [{x:0, y:0, w:6, h:6}] merge([{x:0, y:0, w:1, h:1},…
Louis
  • 4,172
  • 4
  • 45
  • 62
7
votes
2 answers

Pivot duplicates rows into new columns Pandas

I have a data frame like this and I'm trying reshape my data frame using Pivot from Pandas in a way that I can keep some values from the original rows while making the duplicates row into columns and renaming them. Sometimes I have rows with 5…
Zesima29
  • 184
  • 12
7
votes
4 answers

How to delete and shift values in a pandas df column

I have a pandas df that I want to manipulate so it's ordered. So for the df below, I'd like ['I'] to be ordered. So values would read 10-50. I have 2 options to do this; 1) Try to delete values in Column ['G'] or ['H']. So if values are == X then…
user9410826
7
votes
4 answers

Moving part of a git repository’s history into another repository

There are lots of posts on here about moving a folder out of one repository into a new repository using git filter-branch; what I need to do is move a single file into a new repository. I’ve already created the new repository, and added the old one…
ELLIOTTCABLE
  • 17,185
  • 12
  • 62
  • 78
7
votes
5 answers

How safe are automatic merges in Mercurial?

In Mercurial there is the fetch extension that you can use to emulate something like svn update, i.e. to merge with incoming changes without even looking at them. But even if you don't use hg fetch, most of your merges will "miraculously" work…
Lóránt Pintér
  • 10,152
  • 14
  • 47
  • 53
7
votes
4 answers

finding intersection of intervals in pandas

I have two dataframes df_a= Start Stop Value 0 0 100 0.0 1 101 200 1.0 2 201 1000 0.0 df_b= Start Stop Value 0 0 50 0.0 1 51 300 1.0 2 301 1000 0.0 I would like to generate a DataFrame…
00__00__00
  • 4,834
  • 9
  • 41
  • 89
7
votes
1 answer

Mercurial merge strategy vs Git merge strategy

I've used git for years, and recently switched to mercurial for a project. I've learned how to use Mercurial quite well via the command line over the past 6 months. This could be my imagination, but it seems to me that mercurial is much worse at…
TheJeff
  • 3,665
  • 34
  • 52