Python/List: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
c = np.float32([1.0, 2.0, 3.0, 4.0])
c = np.float32([1.0, 2.0, 3.0, 4.0])
d = np.float64([1.0, 2.0, 3.0, 4.0])
d = np.float64([1.0, 2.0, 3.0, 4.0])
e = np.empty((256, 256, 4), dtype=np.uint8)
a.tolist()
a.tolist()
</source>
</source>
|}
|}

Revision as of 09:25, 2 July 2018

TODO Code
List with indices.
for idx, item in enumerate(items):
    print(idx, val)
NumPy
import numpy as np

a = np.int32([1, 2, 3, 4])
b = np.int64([1, 2, 3, 4])
c = np.float32([1.0, 2.0, 3.0, 4.0])
d = np.float64([1.0, 2.0, 3.0, 4.0])
e = np.empty((256, 256, 4), dtype=np.uint8)
a.tolist()