Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixes TypeError#214
The issue is about unpacking the numpy float.64 objects but as they are non-iterable they cannot e iterarated rather we can still access it's values with the given code.
  • Loading branch information
th-shristi authored Sep 23, 2023
commit cf6e525e167d39d49d0dc79cc8b39c168e1121e3
14 changes: 14 additions & 0 deletions TypeError#214
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
numpy float.64 is a non-iterable so you can not directly unpack it as you do with the iterables like list or tuple.
However, you can get access it's value directly as-

import numpy as np

# Create a numpy.float64 object
my_float = np.float64(42.0)

# Access its value
value = my_float.item()
print(value) # This will print: 42.0

numpy.float64 objects are typically used for numerical computations, and you rarely need to "unpack" them in the same way you would with iterable data structures.
Instead, you work with them directly as numeric values.