Skip to content

concatenate gives unexpected zeros when axis=1 #5030

Closed

Description

@ajpotts

In this example I would not expect to see the second column zeroed out:

In [11]: size = 10

In [13]: t = ak.array([0.0, 0.111111, 0.222222, 0.333333, 0.444444, 0.555556, 0.666667, 0.777778, 0.888889, 1.0])

In [14]: s0v = ak.array([0.0,0.0])

In [15]: s1v = ak.array([4.0, 5.0])

In [16]: n = 10

In [17]: M = 2

In [18]: out_dt = ak.float64

In [19]:     cols = []
    ...:     for j in range(M):
    ...:         col = ((1 - t) * s0v[j] + t * s1v[j]).astype(out_dt)       # (n,)
    ...:         cols.append(col.reshape((n, 1)))    # (n,1)
    ...: 

In [20]: cols
Out[20]: 
[array([array([0.00000000000000000]) array([0.44444400000000001]) array([0.88888800000000001]) array([1.333332]) array([1.777776]) array([2.2222240000000002]) array([2.666668]) array([3.1111119999999999]) array([3.5555560000000002]) array([4.00000000000000000])]),
 array([array([0.00000000000000000]) array([0.55555500000000002]) array([1.11111]) array([1.6666650000000001]) array([2.2222200000000001]) array([2.7777800000000004]) array([3.3333349999999999]) array([3.88889]) array([4.444445]) array([5.00000000000000000])])]

In [21]: mat = ak.concatenate(cols,axis=1)

In [22]: mat
Out[22]: array([array([0.00000000000000000 0.00000000000000000]) array([0.44444400000000001 0.00000000000000000]) array([0.88888800000000001 0.00000000000000000]) array([1.333332 0.00000000000000000]) array([1.777776 0.00000000000000000]) array([0.00000000000000000 0.00000000000000000]) array([0.55555500000000002 0.00000000000000000]) array([1.11111 0.00000000000000000]) array([1.6666650000000001 0.00000000000000000]) array([2.2222200000000001 0.00000000000000000])])

Activity

  1. added
    bug
    on Oct 29, 2025
  2. self-assigned this
    on Nov 14, 2025
  3. changed the title [-]concatonate gives unexpected zeros when axis=1[/-] [+]concatenate gives unexpected zeros when axis=1[/+] on Nov 14, 2025
  4. added a commit that references this issue on Nov 14, 2025
    da6d605
  5. added a commit that references this issue on Nov 17, 2025
    8b9e55f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions