Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Fill with -1 instead of nan when dtype is integer#13

Open
fanurs wants to merge 1 commit intocasangi:masterfrom
fanurs:fanurs/fix-read_simple_table
Open

Fill with -1 instead of nan when dtype is integer#13
fanurs wants to merge 1 commit intocasangi:masterfrom
fanurs:fanurs/fix-read_simple_table

Conversation

@fanurs
Copy link
Copy Markdown

@fanurs fanurs commented Sep 24, 2022

Hi! While learning about the prototype, I encountered an error when running the Data Structures Colab notebook:
image

The error comes from the following line:

data = np.stack([np.pad(rr[col], [(0,ss) for ss in mshape - np.array(rr[col]).shape], 'constant', constant_values=np.nan) for rr in tr])

Specifically, because assoc_spw_id has a dtype of integer, it is impossible to fill it with np.nan.

I am not very familiar with the context of these data, but a quick fix would be to fill it with, say, -1 (in this PR), or to simply convert the dtype into float.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant