598
600
_app = qapplication()
600
602
arr = np.array(["kjrekrjkejr"])
601
print "out:", test_edit(arr, "string array")
602
arr = np.array([u"kjrekrjkejr"])
603
print "out:", test_edit(arr, "unicode array")
603
print("out:", test_edit(arr, "string array"))
604
from spyderlib.py3compat import u
605
arr = np.array([u("kjrekrjkejr")])
606
print("out:", test_edit(arr, "unicode array"))
604
607
arr = np.ma.array([[1, 0], [1, 0]], mask=[[True, False], [False, False]])
605
print "out:", test_edit(arr, "masked array")
606
arr = np.zeros((2,2), {'names': ('red', 'green', 'blue'),
608
print("out:", test_edit(arr, "masked array"))
609
arr = np.zeros((2, 2), {'names': ('red', 'green', 'blue'),
607
610
'formats': (np.float32, np.float32, np.float32)})
608
print "out:", test_edit(arr, "record array")
611
print("out:", test_edit(arr, "record array"))
609
612
arr = np.array([(0, 0.0), (0, 0.0), (0, 0.0)],
610
613
dtype=[(('title 1', 'x'), '|i1'),
611
614
(('title 2', 'y'), '>f4')])
612
print "out:", test_edit(arr, "record array with titles")
615
print("out:", test_edit(arr, "record array with titles"))
613
616
arr = np.random.rand(5, 5)
614
print "out:", test_edit(arr, "float array",
615
xlabels=['a', 'b', 'c', 'd', 'e'])
617
print("out:", test_edit(arr, "float array",
618
xlabels=['a', 'b', 'c', 'd', 'e']))
616
619
arr = np.round(np.random.rand(5, 5)*10)+\
617
620
np.round(np.random.rand(5, 5)*10)*1j
618
print "out:", test_edit(arr, "complex array",
621
print("out:", test_edit(arr, "complex array",
619
622
xlabels=np.linspace(-12, 12, 5),
620
ylabels=np.linspace(-12, 12, 5))
623
ylabels=np.linspace(-12, 12, 5)))
621
624
arr_in = np.array([True, False, True])
623
626
arr_out = test_edit(arr_in, "bool array")
624
print "out:", arr_out
625
print arr_in is arr_out
627
print("out:", arr_out)
628
print(arr_in is arr_out)
626
629
arr = np.array([1, 2, 3], dtype="int8")
627
print "out:", test_edit(arr, "int array")
630
print("out:", test_edit(arr, "int array"))
630
633
if __name__ == "__main__":