File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -571,15 +571,19 @@ def as_ctypes(obj):
571
571
572
572
>>> inferred_int_array = np.array([1, 2, 3])
573
573
>>> c_int_array = np.ctypeslib.as_ctypes(inferred_int_array)
574
- >>> c_int_array
575
- <c_long_Array_3 at 0x1071fbed0>
574
+ >>> type(c_int_array)
575
+ <class 'c_long_Array_3'>
576
+ >>> c_int_array[:]
577
+ [1, 2, 3]
576
578
577
579
Create ctypes object from explicit 8 bit unsigned int ``np.array`` :
578
580
579
581
>>> exp_int_array = np.array([1, 2, 3], dtype=np.uint8)
580
582
>>> c_int_array = np.ctypeslib.as_ctypes(exp_int_array)
581
- >>> c_int_array
582
- <c_ubyte_Array_3 at 0x10755a950>
583
+ >>> type(c_int_array)
584
+ <class 'c_ubyte_Array_3'>
585
+ >>> c_int_array[:]
586
+ [1, 2, 3]
583
587
584
588
"""
585
589
ai = obj .__array_interface__
You can’t perform that action at this time.
0 commit comments