1
+ New features
2
+ ------------
3
+
4
+ * implemented set_axes () method to replace one, several or all axes of an array (closes :issue:`67 `).
5
+ The method with_axes() is now deprecated (set_axes() must be used instead).
6
+
7
+ >>> arr = ndtest((2 , 3 ))
8
+ >>> arr
9
+ a\\b | b0 | b1 | b2
10
+ a0 | 0 | 1 | 2
11
+ a1 | 3 | 4 | 5
12
+ >>> row = Axis(' row' , [' r0' , ' r1' ])
13
+ >>> column = Axis(' column' , [' c0' , ' c1' , ' c2' ])
14
+ Replace one axis (second argument `new_axis` must be provided)
15
+ >>> arr.set_axes(x.a, row)
16
+ row\\b | b0 | b1 | b2
17
+ r0 | 0 | 1 | 2
18
+ r1 | 3 | 4 | 5
19
+ Replace several axes (keywords, list of tuple or dictionary)
20
+ >>> arr.set_axes(a=row, b=column)
21
+ row\\column | c0 | c1 | c2
22
+ r0 | 0 | 1 | 2
23
+ r1 | 3 | 4 | 5
24
+ >>> arr.set_axes([(x.a, row), (x.b, column)])
25
+ row\\column | c0 | c1 | c2
26
+ r0 | 0 | 1 | 2
27
+ r1 | 3 | 4 | 5
28
+ >>> arr.set_axes({x.a : row, x.b : column})
29
+ row\\column | c0 | c1 | c2
30
+ r0 | 0 | 1 | 2
31
+ r1 | 3 | 4 | 5
32
+ Replace all axes (list of axes or AxisCollection)
33
+ >>> arr.set_axes([row, column])
34
+ row\\column | c0 | c1 | c2
35
+ r0 | 0 | 1 | 2
36
+ r1 | 3 | 4 | 5
37
+ >>> arr2 = ndrange([row, column])
38
+ >>> arr.set_axes(arr2.axes)
39
+ row\\column | c0 | c1 | c2
40
+ r0 | 0 | 1 | 2
41
+ r1 | 3 | 4 | 5
42
+
43
+ * implemented from_string() method to create an array from a string:
44
+
45
+ >>> from_string(' ' ' age,nat\\ sex, M, F
46
+ ... 0, BE, 0, 1
47
+ ... 0, FO, 2, 3
48
+ ... 1, BE, 4, 5
49
+ ... 1, FO, 6, 7' ' ' )
50
+ age | nat\sex | M | F
51
+ 0 | BE | 0 | 1
52
+ 0 | FO | 2 | 3
53
+ 1 | BE | 4 | 5
54
+ 1 | FO | 6 | 7
55
+
56
+ * allowed to use a regular expression in split_axis method (closes :issue:`106 `):
57
+
58
+ >>> combined = ndrange(' a_b = a0b0..a1b2' )
59
+ >>> combined
60
+ a_b | a0b0 | a0b1 | a0b2 | a1b0 | a1b1 | a1b2
61
+ | 0 | 1 | 2 | 3 | 4 | 5
62
+ >>> combined.split_axis(x.a_b, regex=' (\w {2})(\w {2})' )
63
+ a\\b | b0 | b1 | b2
64
+ a0 | 0 | 1 | 2
65
+ a1 | 3 | 4 |
66
+
67
+ * implemented Axis.by() which is equivalent to axis[:].by()
68
+
69
+ >>> Axis(' age' , range(10 )).by(3 , 4 )
70
+ (age.i[0 :3 ], age.i[4 :7 ], age.i[8 :10 ])
71
+
72
+ Miscellaneous improvements
73
+ --------------------------
74
+
75
+ * added installation instructions (closes :issue:`101 `).
76
+
77
+ * viewer : make shortcuts work even when the focus is not on the array editor widget
78
+ (ie it is on the array list, or on the interactive console) (closes :issue:`102 `).
79
+
80
+ * allowed matrix multiplication (@ operator ) between arrays with dimension != 2 (closes :issue:`122 `).
81
+
82
+ * viewer : automatically display plots done in the viewer console in a separate window
83
+ (unless " %matplotlib inline" is used). Plots can be done via the array widget
84
+ (using shortcut CTRL+P or right click) or from the console:
85
+
86
+ >>> arr = ndtest((3 , 3 ))
87
+ >>> arr.plot()
88
+
89
+ Now both methods generate a plot in separate window.
90
+
91
+ * improved LArray.plot to get nicer plots by default.
92
+ The axes are transposed compared to what they used to, because the last axis is often used for time series.
93
+ Also it considers a 1D array like a single series, not N series of 1 point.
94
+
95
+ * added possibility to tag multiple groups with an axis in one shot (backward incompatible)
96
+
97
+ >>> year = Axis(' year' , ' 2001 .. 2010' )
98
+ >>> year.group(' 2001,2002;2003:2008;2009,2010' )
99
+ [[2001, 2002], slice(2003 , 2008 , None), [2009, 2010]]
100
+
101
+ Fixes
102
+ -----
103
+
104
+ * viewer: allow changing the number of displayed digits even for integer arrays as that makes sense when using
105
+ scientific notation (closes :issue:`100 `).
106
+
107
+ * viewer : fixed opening a viewer via view() edit() or compare() from within the viewer
108
+ (closes :issue:`109 `)
109
+
110
+ * viewer : fixed compare() colors when arrays have values which are very close but not exactly equal
111
+ (closes :issue:`123 `)
112
+
113
+ * viewer : fixed legend when plotting arbitrary rows (it always displayed the labels of the first rows)
114
+ (closes :issue:`136 `).
115
+
116
+ * fixed posargsort labels (closes :issue:`137 `).
0 commit comments