Skip to content

Instantly share code, notes, and snippets.

@domitry

domitry/test.rb

Created Mar 25, 2015
Embed
What would you like to do?
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])
@domitry

This comment has been minimized.

Copy link
Owner Author

@domitry domitry commented Mar 25, 2015

こういうのをnumpyで高速にやりたい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment