Questions tagged [remap]
257 questions
573
votes
12 answers
Remap values in pandas column with a dict, preserve NaNs
I have a dictionary which looks like this: di = {1: "A", 2: "B"}
I would like to apply it to the col1 column of a dataframe similar to:
col1 col2
0 w a
1 1 2
2 2 NaN
to get:
col1 col2
0 w a
1 …

TheChymera
- 17,004
- 14
- 56
- 86
41
votes
6 answers
How to remap "Context Menu" key in Mac OS X?
I have a Logitech keyboard (Ultra-Flat Keyboard Dark Shine to be exact), which has the context menu key in the middle of the windows and alt key, which is quite annoying.
Here's a screenshot of where the key…
Alvin
33
votes
5 answers
Color similarity/distance in RGBA color space
How to compute similarity between two colors in RGBA color space? (where the background color is unknown of course)
I need to remap an RGBA image to a palette of RGBA colors by finding the best palette entry for each pixel in the image*.
In the RGB…

Kornel
- 97,764
- 37
- 219
- 309
32
votes
2 answers
How do I use OpenCV's remap function?
Here's the simplest possible test case for remap():
import cv2
import numpy as np
inimg = np.arange(2*2).reshape(2,2).astype(np.float32)
inmap = np.array([[0,0],[0,1],[1,0],[1,1]]).astype(np.float32)
outmap =…

john k
- 6,268
- 4
- 55
- 59
27
votes
7 answers
Why is so complicated to remap Esc to CAPS LOCK in Vim?
I saw the vim wiki tips and it says that in order to remap Esc to CAPS LOCK you have to edit the following windows code:
REGEDIT4
[HKEY_CURRENT_USER\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00
Is…

alexchenco
- 53,565
- 76
- 241
- 413
26
votes
11 answers
Inverting a real-valued index grid
OpenCV's remap() uses a real-valued index grid to sample a grid of values from an image using bilinear interpolation, and returns the grid of samples as a new image.
To be precise, let:
A = an image
X = a grid of real-valued X coords into the…

SuperElectric
- 17,548
- 10
- 52
- 69
21
votes
5 answers
Vim: remap key to toggle line numbering
I added:
set number
nnoremap :set nonumber!
to my vimrc file. Basically what it's supposed to do is let me press F2 to toggle line numbering but it's not working. What have I done wrong?

Nope
- 34,682
- 42
- 94
- 119
21
votes
5 answers
Remap or Map function in Javascript
Of late, most of my programming experience has been in Processing, and more recently I have been wanting to branch out a little deeper in to some JavaScript, since they are slightly related.
I was just wondering, as my recent searching has turned…
user553149
19
votes
3 answers
Visual Studio 2010: How Can I remap F2 to Rename File rather than Open Object Browser
In Visual Studio 2010 Solution Explorer tree view, how can I remap the F2 key to Rename the Selected File rather than open Object Browser?

Gordon Bell
- 13,337
- 3
- 45
- 64
19
votes
3 answers
How to remap keys in Chrome OS?
For someone who uses the Ctrl-W bindings in vim habitually, it is incredibly annoying to have Chrome OS ask me, "Wanna close this window, then?"
How do I remap keys in Chrome OS? Can't find this top secret setting anywhere.

JD.
- 3,005
- 2
- 26
- 37
16
votes
2 answers
vim change :x function to delete buffer instead of save & quit
I want to set :x in vim gui-mode to delete buffer because I always kill the whole gvim, which is kind of annoying. I know i can specifically set gui problems with if has("gui running") but don't know how to remap :x
thanks in advance
ps.: maybe the…

epsilonhalbe
- 15,637
- 5
- 46
- 74
11
votes
2 answers
Overriding a remapping from a plugin?
After installing vim-ruby-debugger that plugin "hijacks" several mappings. Like n, or t which I use for respectively NERDTreeToggle and Command-T find.
The culprit is found at the hardcoded mappings in this ruby-debugger.
I'd prefer…

berkes
- 26,996
- 27
- 115
- 206
10
votes
3 answers
vim - remapping >> << (indent commands)
I would love to map << and >> to single keys to speed up my workflow, but I can't find any info on how to write the remap in my vimrc. Any idea how I can get my remap on?

tester
- 22,441
- 25
- 88
- 128
10
votes
2 answers
Is there a good workaround to the Oracle IMPDP REMAP_SCHEMA issue with triggers (ORA-39083, ORA-00942)?
One can use the Oracle data pump import tool (IMPDP.EXE) to import one schema into another using the REMAP_SCHEMA option. However there is an issue in that triggers are not properly remapped. This leads to the trigger not being created at all with…

VinceJS
- 1,254
- 3
- 18
- 38
8
votes
1 answer
C++ algorithm to convert a fisheye image to an equirectangular image with OpenCV4
I want to create a C++ code with the OpenCV4 library that convert a fisheye image to an equirectangular image. I'm using as a test a fisheye image of 1400*1400 pixels loading from a file on my Computer:
The build works well but when I try to…

KenZone51
- 181
- 2
- 7