25,235 questions
1
vote
1
answer
114
views
How to duplicate columns with a prefix/suffix when flattening a DataFrameGroupBy
I've been working on a project to learn Python and play around with machine learning that uses data from the NHL's public API. I've been able to teach myself via documentation and Google searches so ...
3
votes
1
answer
129
views
Use pandas merge_asof to achieve inexact left join
I have two pandas series:
right_series
Index
Value
1
0.1
2
0.2
3
0.3
6
0.6
7
0.7
left_series
Index
Value
1
0.1
5
0.5
10
1.0
I would like to join right_series on left_series by the indices, such that ...
0
votes
0
answers
40
views
How to merge rows with the same ID into one row by taking non-null values
I am working with a table in DolphinDB where multiple rows share the same id, and each row contains non-null values in different columns. My goal is to consolidate these rows into a single row for ...
0
votes
1
answer
36
views
Dataverse Dataflow is scrambling the order of returned rows in merge step
I have 2 queries in a Dataverse Dataflow ("Table 1" and "Table 2") that I combine in a new Append Query ("Append Table 1 & 2").
I then merge "Append Table 1 &...
1
vote
1
answer
114
views
Combining Two Dataframes Based on Multiple Conditions & Removing Rows that Don't Match
I need to combine two dataframes: one with detection data and another with the metadata for those detections.
The column names of the first dataframe, which is called rt_det are:
tag_id, power, ...
0
votes
2
answers
227
views
Why does using >= increase merge sort time complexity
I recently solved the Merge Sorted Array question on leetcode
Here is the part of the code I am having doubts on :
while (curr >= 0 && p1 >= 0 && p2 >= 0) {
// more TC if ...
4
votes
3
answers
111
views
Merging branch based off another branch that since has been merged (with squash and delete)
I am running into some weird merge conflict issues even though I am the only one working on the repository and have only made linear commits.
I have these branches:
main
feature-A (based off of main)
...
-7
votes
1
answer
182
views
How should I efficiently add all pairs in a key-value array to an object?
I have an object obj; and I then obtain an array arr of key-value pairs. Assuming that the key sets of obj and of arr are disjoint (i.e. no key appears in both) - how do I efficiently add all pairs in ...
0
votes
0
answers
29
views
How to map geoname ids to geoboundary shapeIDs?
I'm looking to map either wikidata ids or GeoName ids to geoBoundary shapeIDs for ADM1 and ADM2. I'm not sure if there is a straightforward way to do this.
For example, here is the GeoName entry for ...
6
votes
2
answers
201
views
How to drop duplicate values when merging dataframes
I have a DataFrame that I want to merge and drop only duplicates values based on column name and row. For example, key_x and key_y has the
same values in the same row in row 0,3,10,12,15.
My DataFrame
...
0
votes
2
answers
181
views
Error due to single-level dataframe merge with multi-level indexed dataframe
# Read lookup file which only contains 5 columns.
df_lookup = pd.read_excel(
os.path.join(path, 'lookup.xlsx'),
index_col=[0, 1, 2, 3, 4])
# sample df_lookup
# |A |B |C |D |E |
# |--|--|--|--|...
2
votes
1
answer
67
views
How to join a pivoted table with other tables
I’m working with the DolphinDB Python API to analyze financial data, but I can’t join a table transformed by pivotby() with another table directly. The error says TablePivotBy has no merge attribute. ...
4
votes
3
answers
101
views
Looking for a clean way to reword a few commits from before multiple merges were done without having to re-resolve conflicts
Note: I have already looked at the following answers and they don't seem to apply or work in the way I expect them to work:
Reword one commit prior to merge
Squashing old git commits that were before ...
-1
votes
1
answer
135
views
How can I merge two lists in Python while removing duplicates but preserving the original order? [duplicate]
I have two lists in Python:
list1 = [1, 2, 3, 4]
list2 = [3, 4, 5, 6]
I want to merge them into a single list such that:
No duplicates remain
The original order of elements is preserved
For the ...
0
votes
0
answers
52
views
join not merging data from both tables rapidminer
I am trying to join two outlier tests, by attribute id, the outliers discovered from LOF_Outliers and the outliers discovered from Distance_Outliers.
But only one of these two outliers is showing:
...
2
votes
1
answer
93
views
Why is `git merge-base` non-deterministic?
This is a follow-up question to my attempt at debugging a merge conflict. Instead of the complex case there, consider the following script that re-creates the "same" repo every time:
#!/bin/...
1
vote
0
answers
152
views
In a merge conflict, why would `git log --merge` only show a single commit?
I'm trying to merge the branch feature1 into the branch main, but I'm getting merge conflicts:
$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working ...
1
vote
2
answers
104
views
How to find columns not matching in Pandas Merge?
I'm performing data validation in Python using the Pandas module. I have two datasets to compare source and target data for expected values. I've successfully merged two dataframes using pd.merge and ...
0
votes
1
answer
209
views
Diagnosing duplicate inserts after merge/upsert with deltalake (Python)
I’d really appreciate your help with a duplication issue I’m hitting when using deltalake merges (Python).
Context
Backend: Azure Blob Storage
Libraries: deltalake 1.1.4 (Python), Polars 1.31.0 (...
0
votes
2
answers
141
views
Pandas merge one-to-many [duplicate]
I'm trying to merge two pandas DataFrames on multiple columns. It is a many-to-one relationship. There are many of the same values in df1 but only value in df2.
These are the example DataFrames :
df1 =...
0
votes
0
answers
72
views
GitHub updating old PR branch
I have about a year old branch with submitted PR.
About 6 month later I tried to pull the latest master in but for some reason didn't finish.
Now I'll try to complete the PR and submit it for ...
2
votes
3
answers
146
views
How to left join two datasets in r based on several conditions? [closed]
I have two datasets (Each dataset around 1.8M rows), one contains per second data, and the other one sometimes have per second, every two second, or three second. I wanted to join these two datasets, ...
1
vote
3
answers
94
views
Merge data between 2 tables using the same primary key but different record count
I have 2 tables - Car1:
And Car2:
S_No
Brand
Type
Cost
Tax
Discount
Launch Month
4
Maruti
Baleno
2000000
10
6
June
5
Maruti
Baleno
2500000
11
8
June
Primary key is S.No. column. However, the ...
0
votes
2
answers
131
views
How to merge only some commits from master to version branch?
We have a challenge with how things have been merged into two different branches in our (public) Git repository.
We have two branches:
master (commits: a, b, c, d, e)
maintenance-8.x.x (commits: a, x, ...
2
votes
2
answers
91
views
How to vertically merge more than one column based a factor column
Please help find a solution that allows one to merge multiple columns respective to a grouping column. In the reproducible example I want to merge columns v2 and v3 within the respective groups (a,b,c)...
-1
votes
2
answers
131
views
Git fixup after a merge with upsteam
Scenario:
work... work... work... git commit -m "Step1"
work... work... work... git commit -m "Step2"
work... work... work... git commit -m "Step3"
git pull # merge a ...
-1
votes
1
answer
64
views
merge sorted array wrong result not sure why? [duplicate]
I am doing this challenge but I am getting two different results one on my pycharm and one on the leet code webpage.
my code on pycharm:
nums1 = [1,2,3,0,0,0]
m = 3
nums2 = [2,5,6]
n = 3
print(nums1[0:...
-2
votes
1
answer
68
views
merge files in one commit without adding one commit in Git
Normally we will do git merge commit_hash or git cherry-pick commit_hash to merge.
However here I want one a bit different behavior. Assume git diff commit_hash~1 commit_hash shows some files are ...
6
votes
2
answers
247
views
Merge Two Sorted Lists in C
test case
I don't understand why I have problems with one test case on the inputs I have — it fails:
1. list1 = [];
2. list2 = [0];
Here is my code:
struct ListNode* mergeTwoLists(struct ListNode* ...
1
vote
2
answers
80
views
Loop through records and merge duplicate records [duplicate]
I am trying to get this work and feeling that I am on the wrong path but I can't figure out how to make this simple (and working)
Here is the data in my mysql table:
title
size
title 1
S
title 1
L
...
-3
votes
1
answer
82
views
Merge selected worksheets in Excel
I tried to merge multi worksheets in Excel. But my code merges all active worksheets including hidden sheets.
I want to merge only the selected worksheets, instead. The selection can be by selecting ...
0
votes
0
answers
201
views
How do I merge Emoji font with text font and make a single ttf file?
I'm trying to merge this emoji font file https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf
with a text font file I'm using Carimba Script.ttf for the text.
I tried fontforge ...
0
votes
1
answer
87
views
Why do I still show local files from a branch after a git revert of the merge?
I am a newcomer to Git and am probably missing something basic.
My desired practice is to create a branch from main, work on a given release in that branch, and merge to main when release code is ...
2
votes
1
answer
186
views
Visual Studio Code, fully manual merge?
I merged two branches and the resulting code crashed. I did a git diff and studied it carefully. Now I would like to go back and use the VSCode merge tool to do a fully manual merge of these two ...
1
vote
1
answer
62
views
Combine two pandas Dataframes with Timestamp Index
I have two dataframes with timestamp data. It is sensor readouts from different sources.
I want to combine them. The left dataframe (df1) can be quite large as it will be a combination of multiple ...
0
votes
1
answer
51
views
How to merge two lists based on a matching string and assign incremental numbers to each object using Mulesoft DataWeave
How can I merge the following two lists ids and attributes based on the matching did field and for each matched pair increment the iterid values
For example I have two lists below. size of the list ...
0
votes
1
answer
136
views
Show differences between commits with respect to a base
We use a common git strategy:
branch from main to a feature branch.
do commits in feature.
if main progresses, merge it to feature.
merge feature to main.
I want to view the changes that happened ...
1
vote
1
answer
119
views
The data is changed after fwrite and fread
I am trying to store several columns of the data, and then merge them with the other data when necessary. However, the data could only be merged with other data when I created it at the start, and it ...
0
votes
0
answers
190
views
Winmerge 3-way compare configuration
I use Git to invoke Winerge, and this is the current setting:
[mergetool "winmerge"]
cmd = \"C:/Users/RD/WORK_FILES/Tools/WinMergePortable/App/WinMerge64/WinMergeU.exe\" \
...
-2
votes
3
answers
183
views
How can I work on multiple git branches at once?
Clarification: I'm asking about working on multiple branches in the same worktree. (I know how to work on multiple branches in separate worktrees, but that's not the question here.)
Suppose I'm ...
0
votes
2
answers
152
views
Merge multi Excel files into one worksheet with VBA
I tried to merge multiple Excel files into one single worksheet with VBA but it only put all sheets into one workbook. I also want to add one first column with the name of individual Excel files.
How ...
0
votes
0
answers
130
views
The merge time of ClickHouse is too long
Last month, there was an issue on our server where the ClickHouse merge process took an excessively long time. This process lasted for nearly three hours and kept the CPU load at a high level. Below ...
0
votes
1
answer
118
views
Show a git merge commit in three-panel form in meld
This question shows many good ways to use git-mergetool to show the condition of files before a merge commit using meld:
Setting up and using Meld as your Git difftool and mergetool
I like the three-...
1
vote
1
answer
68
views
Merging multiple NetCDFs from Copernicus into one NetCDF in Rstudio for plotting
I am trying to merge multiple NetCDFs containing 4 dimensions (lat, lon, depth, time) into one NetCDF. Each contain the same variable (sea surface temperature or 'thetao') and the same depth value and ...
0
votes
1
answer
207
views
Merge multiple NetCDF files with `cdo` or `nco` along a dimension other than time
I have two or more NetCDF files that share a time dimension and time variable, where the time variable is the same for all the files (from the start to the end of the time period, unit, etc). The ...
1
vote
0
answers
79
views
Information Retrieval Systems: Optimizing a merging algorithm for partial indices
I am currently working on an information retrieval system for an academic course project. In this phase I am required to index a large collection of documents (107000 .nxml files) which, if you don't ...
1
vote
1
answer
769
views
Embarrassing myself with git merge - adds a bunch of files and commits to my PR that I hadn't touched
Git novice here. tl;dr: I don't understand why already merged commits end up in my PR. Going to number my steps here so people can point out where I went wrong with a number.
So I'm working on a ...
0
votes
1
answer
45
views
Combine dataframes fuzzy matching on time
I have two dataframes, dfA and dfB, whose primary key is an ID and a datetime object each stored in a column.
I wish to merge these dataframes on the ID & time if the ID is identical AND if the ...
1
vote
2
answers
74
views
PL SQL: inner Function within Merge is called more often than expected
I got a setup where I would like to call a function once per group and apply the result to multiple rows (multiple eans). However, the function is called as many times as I have eans. This might be ...
0
votes
1
answer
196
views
Databricks merge issue with null values
I'm merging two delta tables with databricks and one struct in the target delta table isn't merged as expected.
On the source delta table I have data as follow:
{
id: '123',
artist: {
song: {
...