22 questions
-1
votes
1
answer
54
views
How to export heterogenous arrays to csv
Basically what im trying to do is export np.arrays to a .csv file where my data can be stored neatly. I've tried doing this code, but it doesn't work as i would like to.
import numpy as np
import ...
2
votes
1
answer
75
views
Is it possible to use Ruby FFI to send a Ruby (C API) VALUE to a function?
I'm currently trying to bridge Numo::NArray and FFI, so that an FFI Pointer can access the raw data in a Numo::NArray without having to copy data through String like I do now (thus causing GC churn ...
0
votes
1
answer
46
views
How to configure Fedora 29 to use ruby 'number-theory' gem?
So basically RubyNumberTheory require the NArray gem, and it seems it requires some native compilation tools and probably some additional configuration. So on a Fedora 29, here is what was tried
$ ...
1
vote
1
answer
258
views
Ruby matrix addition to multi dimensional array
Multidimensional Matrix array is like this
arr1 = Matrix[[0.9742006046104146, 0.9164380106962612, 0.39571440216724874],
[1.3793903493310324, 1.8988033906016721, 1.2768961254764901],
...
2
votes
1
answer
453
views
Ruby's narray gem installation error on Windows
I'm trying to install the NArray gem for Ruby to do some math functions. I'm running Ruby version 2.0.0p353 [x64-mingw32] on Windows with gem 2.014
When I attempt to install the NArray gem, it ...
2
votes
2
answers
312
views
Converting NArray to Magick::Image in Ruby
Is there an efficient way to create an RMagick image from the data in a 2D NArray (a Ruby class that's supposed to be more efficient than regular arrays), or are the two libraries just incompatible in ...
1
vote
2
answers
177
views
Ruby NArray optimisations for downsample and conditional change
I am creating input to ruby-fann, doing as much manipulation in narray as I can for performance reasons. Typically I am manipulating 2D 200x200 arrays of floats, and need to repeat processing many ...
0
votes
1
answer
515
views
Convert vector to integer
Knowing the multidimensional-array's shape of a vector, how can we convert it into a new vector of one dimension (by flatten the multidimensional-array)?
For example considering the following array:
...
1
vote
1
answer
147
views
How to expand/reduce a two-dimensional Ruby NArray?
If I have a Narray with the shape 100, 10000 and want to expand it to say 100, 20000 (basically add rows) what is the proper way to achieve this? To expand massive Narrays I would like to avoid using ...
2
votes
2
answers
147
views
Replacing values in a byte type NArray in Ruby
I am looking for a way to replace all occurrences of 'A' with 1, 'T' with 2, 'C' with 8, and 'G' with 16 in a byte array. How can this be done?
1
vote
1
answer
71
views
How to locate intervals of non-empty values in Ruby's NArray?
I am interested in locating all non-empty intervals in a NArray as tuples of [begin, end] type. So if we have a NArray of a given size and all values at index positions 100 ... 200, 300 ... 400, etc ...