Add an example for an equivalent of numpy's column_stack function in ndarray_for_numpy_users

Đang mở
#650 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
documentation

Hướng nghiên cứu

Start in the ndarray_for_numpy_users documentation section and compare its existing examples with NumPy's column_stack reference. Add a documented Rust example based on stack(Axis(1), ...), with the work complete when the section clearly shows the equivalent operation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

docs good first issue

I was looking for an equivalent function of numpy's column_stack (see https://docs.scipy.org/doc/numpy/reference/generated/numpy.column_stack.html) in ndarray docs.

This is how I managed to solve the issue:

use ndarray::{Array, Axis, stack, arr2};

let a = Array::linspace(0., 1., 5).into_shape((5,1)).unwrap();
let b = Array::<f64, _>::ones((5, 1));
let res = stack(Axis(1), &[b.view(), a.view()]);
assert!(res == Ok(arr2(&[[1., 0.],
                 [1., 0.25],
                 [1., 0.5],
                 [1., 0.75],
                 [1., 1.]])));

It could be worth to have an example in ndarray_for_numpy_users section of the docs.

Ngôn ngữ chính
Rust
Star
4.3k
Fork
391
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-ndarray/ndarray

Tất cả issue của rust-ndarray/ndarray

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.