Accepting integer arguments for Array::range?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by inspecting the Array::range and Linspace APIs and the discussion in issue #493, then review ndarray_for_numpy_users/index.html for the requested documentation context. Determine the intended behavior for integer arguments and whether the numpy.astype guidance should also be documented; done means the supported behavior or limitation is covered by appropriate tests and documentation.
Written by the indexing model from the issue text.
Description
Right now I'm trying to pass integer arguments to Array::range. I have to first cast arguments to f32, then casting the result to int doesn't compile arr.mapv(|elem| elem as usize) does it work for Linspace<>?.
I noticed that range() works as I want for end<begin (unlike 5..1 which is empty). However https://github.com/rust-ndarray/ndarray/issues/493#issuecomment-424043912 indicates I will have to perform data copies on every single range() I call, which sounds like a waste of resources.
Why doesn't Array::range and Linspace accept integer values?
- You should document numpy.astype https://github.com/rust-ndarray/ndarray/issues/493 in https://docs.rs/ndarray/0.11.2/ndarray/doc/ndarray_for_numpy_users/index.html .
- Dominant language
- Rust
- Stars
- 4.3k
- Forks
- 391
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-ndarray/ndarray#1612 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-ndarray/ndarray#1617 · 1 comment ·
-
bug good first issue
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rust-ndarray/ndarray#1615 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-ndarray/ndarray#1610 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
rust-ndarray/ndarray#1609 ·
All issues in rust-ndarray/ndarray
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100