Comments (4)
The current release version of NArray does not support error/warning handling in the course of calculation, because it requires an amount of new design and development. How do we switch behaviours? Where is the error information recorded? How do we treat partially calculated array? The future version of NArray may support such features.
from narray.
I am struggling with this issue again (I think):
irb(main):001:0> require 'narray'
=> true
irb(main):002:0> (NArray.int(300).indgen! > 0).sum
=> 43
Please explain to me why this is not returning 299 as expected?
PS
If I am indeed overflowing some 256 char value, I would expect that it could be fixed by converting to an integer array:
irb(main):003:0> (NArray.int(300).indgen! > 0).to_i.sum
=> 43
alas, same wrong result. It seems that byte NArray cannot be converted to int NArray? (no warning no nothing):
irb(main):005:0> NArray.byte(10).to_i
=> NArray.byte(10):
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
irb(main):006:0> NArray.float(10).to_i
=> NArray.int(10):
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
PPS
There are probably a number of different ways to solve the problem like:
irb(main):004:0> (NArray.int(300).indgen!.where > 0).size
=> 299
But I feel that this is actually arriving at the result indirectly.
from narray.
irb(main):002:0> (NArray.int(300).indgen! > 0).count_true
=> 299
from narray.
Neat, however, I am still puzzled about NArray's behaviour in the above circumstances.
from narray.
Related Issues (20)
- Random access file format compatible with NArray? HOT 2
- narray 0.6.0.2 fails test suite HOT 1
- In line 290 of narray_ext.rb (version 0.6.0.3) the coth(x) function is wrongly implemented as 1/atanh(x). The correct implementation would be 1/tanh(x). HOT 1
- 0.6.0.3 is slower than 0.6.0.1 HOT 2
- [0.6.0.5] u_int16_t causing install failure on mingw HOT 1
- Equality specification HOT 2
- to_na instance method HOT 3
- Ruby 2.0 compatibility? HOT 4
- 'lib/complex.rb is deprecated' warning HOT 1
- Add NArray#map alias for NArray#collect HOT 1
- mean/median absolute deviation
- narray 0.6.0.8 test fails HOT 6
- destructive non-bang methods
- Fix NArray to be installable / usable with SciRuby-NMatrix within the same system / environment
- Limit of 16 dimensions to transpose HOT 2
- Make each return an Enumerator object if not given a block to iterate with HOT 1
- Error installing gem on OS X Mavericks and ruby 2.1.3 HOT 1
- Please tag 0.6.1.1 HOT 1
- median(1) returns Numeric instead of NArray HOT 2
- "array size is too large" error based on hardcoded limit -- increase for 64-bit platforms? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from narray.