Skip to content

UserWarning The nodata value has been automatically changed #547

Answered by snowman2
aldotapia asked this question in Q&A
Discussion options

You must be logged in to vote

The warning is informing you that when changing the nodata value to the dtype of you data, it is not equal to the original value:

if not numpy.isnan(nodata) and original_nodata != nodata:
warnings.warn(
f"The nodata value ({original_nodata}) has been automatically "
f"changed to ({nodata}) to match the dtype of the data."
)

This is likely due to loss of precision. I recommend selecting a nodata value appropriate for the datatype you are using.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by aldotapia
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants