Created
March 25, 2015 02:55
-
-
Save domitry/357b83e50566fe6e88cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def replace_val(arr) | |
rule = { | |
hoge: [1, 2, 1], | |
nya: [2, 3, 4], | |
hoe: [1, 2, 3] | |
} | |
return arr.map{|label| rule[label]} | |
end | |
replace_val([:hoge, :nya, :nya, :hoe]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こういうのをnumpyで高速にやりたい