12
12
13
13
@deprecate_kwarg ('nb_index' , 'nb_axes' , arg_converter = lambda x : x + 1 )
14
14
def from_lists (data , nb_axes = None , index_col = None , fill_value = nan , sort_rows = False , sort_columns = False , wide = True ):
15
- """
15
+ r """
16
16
initialize array from a list of lists (lines)
17
17
18
18
Parameters
@@ -49,30 +49,30 @@ def from_lists(data, nb_axes=None, index_col=None, fill_value=nan, sort_rows=Fal
49
49
... ['', 0, 1]])
50
50
sex M F
51
51
0 1
52
- >>> from_lists([['sex\\ \\ year', 1991, 1992, 1993],
52
+ >>> from_lists([['sex\\year', 1991, 1992, 1993],
53
53
... [ 'M', 0, 1, 2],
54
54
... [ 'F', 3, 4, 5]])
55
- sex\\ year 1991 1992 1993
55
+ sex\year 1991 1992 1993
56
56
M 0 1 2
57
57
F 3 4 5
58
58
59
59
Read array with missing values + `fill_value` argument
60
60
61
- >>> from_lists([['sex', 'nat\\ \\ year', 1991, 1992, 1993],
61
+ >>> from_lists([['sex', 'nat\\year', 1991, 1992, 1993],
62
62
... [ 'M', 'BE', 1, 0, 0],
63
63
... [ 'M', 'FO', 2, 0, 0],
64
64
... [ 'F', 'BE', 0, 0, 1]])
65
- sex nat\\ year 1991 1992 1993
65
+ sex nat\year 1991 1992 1993
66
66
M BE 1.0 0.0 0.0
67
67
M FO 2.0 0.0 0.0
68
68
F BE 0.0 0.0 1.0
69
69
F FO nan nan nan
70
70
71
- >>> from_lists([['sex', 'nat\\ \\ year', 1991, 1992, 1993],
71
+ >>> from_lists([['sex', 'nat\\year', 1991, 1992, 1993],
72
72
... [ 'M', 'BE', 1, 0, 0],
73
73
... [ 'M', 'FO', 2, 0, 0],
74
74
... [ 'F', 'BE', 0, 0, 1]], fill_value=42)
75
- sex nat\\ year 1991 1992 1993
75
+ sex nat\year 1991 1992 1993
76
76
M BE 1 0 0
77
77
M FO 2 0 0
78
78
F BE 0 0 1
@@ -84,7 +84,7 @@ def from_lists(data, nb_axes=None, index_col=None, fill_value=nan, sort_rows=Fal
84
84
... [ 'M', 'BE', 1, 0, 0],
85
85
... [ 'M', 'FO', 2, 0, 0],
86
86
... [ 'F', 'BE', 0, 0, 1]], nb_axes=3)
87
- sex nat\\ {2} 1991 1992 1993
87
+ sex nat\{2} 1991 1992 1993
88
88
M BE 1.0 0.0 0.0
89
89
M FO 2.0 0.0 0.0
90
90
F BE 0.0 0.0 1.0
@@ -102,7 +102,7 @@ def from_lists(data, nb_axes=None, index_col=None, fill_value=nan, sort_rows=Fal
102
102
... [ 'F', 'BE', 1991, 0 ],
103
103
... [ 'F', 'BE', 1992, 0 ],
104
104
... [ 'F', 'BE', 1993, 1 ]], wide=False)
105
- sex nat\\ year 1991 1992 1993
105
+ sex nat\year 1991 1992 1993
106
106
M BE 1.0 0.0 0.0
107
107
M FO 2.0 0.0 0.0
108
108
F BE 0.0 0.0 1.0
0 commit comments