himotoyoshi

Results 5 comments of himotoyoshi

This is a sample implementation of `meshgrid` that works for any dimensions and any data types. ```ruby require "numo/narray" class Numo::NArray def self.meshgrid (*axes) shape = axes.map(&:size) axes.map.with_index do |axis,...

> But is this exactly the same as numpy's meshgrid? Sorry, it is not. It is just a sample code for your comment as a Proof of Concept in Ruby...

This is a sample implementation of `meshgrid` in Ruby that can accept full numpy's options. ```ruby require "numo/narray" class Numo::NArray # full version def self.meshgrid (*axes, indexing: "xy", copy: true,...

Sorry. I misunderstood the order of the repetitive dimensions. Here's the corrected version. ```ruby class Numo::NArray # simple version witout copy option def self.meshgrid (*axes, indexing: "xy", sparse: false) case...

Sorry, It wasn't fixed yet. ```ruby class Numo::NArray # simple version witout copy option def self.meshgrid (*axes, indexing: "xy", sparse: false) case indexing when "xy" # no operation when "ij"...