Skip to content

[BUG] Vector.from_numpy chances input on I16 and I32 columns #5

@ft-lakr

Description

@ft-lakr

Description

I am using the Vector.from_numpy method to convert an integer array to a Rayforce Vector. However, I've noticed that some of my values seem to change to 0 when specifying I16 or I32 as the column type.

Sample Data

--

Version

0.6.1

I also tried it in version 0.6.0 before upgrading to 0.6.1 and got the same result

Code Snippet

int_arr = np.array([1, 2, 3, 4])
print('Array dtype:', int_arr.dtype)
int_col = Vector.from_numpy(int_arr, ray_type=I16)
int_col2 = Vector.from_numpy(int_arr, ray_type=I32)
int_col3 = Vector.from_numpy(int_arr, ray_type=I64)
t = Table({'int_col': int_col, 'int_col2': int_col2, 'int_col3': int_col3})
print(t)

Output

When running the code snippet above, I get this output:
Image
The expected output would of course be "1, 2, 3, 4" in all columns, not just the I64 one.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions