1212
1313@deprecate_kwarg ('nb_index' , 'nb_axes' , arg_converter = lambda x : x + 1 )
1414def from_lists (data , nb_axes = None , index_col = None , fill_value = nan , sort_rows = False , sort_columns = False , wide = True ):
15- """
15+ r """
1616 initialize array from a list of lists (lines)
1717
1818 Parameters
@@ -49,30 +49,30 @@ def from_lists(data, nb_axes=None, index_col=None, fill_value=nan, sort_rows=Fal
4949 ... ['', 0, 1]])
5050 sex M F
5151 0 1
52- >>> from_lists([['sex\\ \\ year', 1991, 1992, 1993],
52+ >>> from_lists([['sex\\year', 1991, 1992, 1993],
5353 ... [ 'M', 0, 1, 2],
5454 ... [ 'F', 3, 4, 5]])
55- sex\\ year 1991 1992 1993
55+ sex\year 1991 1992 1993
5656 M 0 1 2
5757 F 3 4 5
5858
5959 Read array with missing values + `fill_value` argument
6060
61- >>> from_lists([['sex', 'nat\\ \\ year', 1991, 1992, 1993],
61+ >>> from_lists([['sex', 'nat\\year', 1991, 1992, 1993],
6262 ... [ 'M', 'BE', 1, 0, 0],
6363 ... [ 'M', 'FO', 2, 0, 0],
6464 ... [ 'F', 'BE', 0, 0, 1]])
65- sex nat\\ year 1991 1992 1993
65+ sex nat\year 1991 1992 1993
6666 M BE 1.0 0.0 0.0
6767 M FO 2.0 0.0 0.0
6868 F BE 0.0 0.0 1.0
6969 F FO nan nan nan
7070
71- >>> from_lists([['sex', 'nat\\ \\ year', 1991, 1992, 1993],
71+ >>> from_lists([['sex', 'nat\\year', 1991, 1992, 1993],
7272 ... [ 'M', 'BE', 1, 0, 0],
7373 ... [ 'M', 'FO', 2, 0, 0],
7474 ... [ 'F', 'BE', 0, 0, 1]], fill_value=42)
75- sex nat\\ year 1991 1992 1993
75+ sex nat\year 1991 1992 1993
7676 M BE 1 0 0
7777 M FO 2 0 0
7878 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
8484 ... [ 'M', 'BE', 1, 0, 0],
8585 ... [ 'M', 'FO', 2, 0, 0],
8686 ... [ 'F', 'BE', 0, 0, 1]], nb_axes=3)
87- sex nat\\ {2} 1991 1992 1993
87+ sex nat\{2} 1991 1992 1993
8888 M BE 1.0 0.0 0.0
8989 M FO 2.0 0.0 0.0
9090 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
102102 ... [ 'F', 'BE', 1991, 0 ],
103103 ... [ 'F', 'BE', 1992, 0 ],
104104 ... [ 'F', 'BE', 1993, 1 ]], wide=False)
105- sex nat\\ year 1991 1992 1993
105+ sex nat\year 1991 1992 1993
106106 M BE 1.0 0.0 0.0
107107 M FO 2.0 0.0 0.0
108108 F BE 0.0 0.0 1.0
0 commit comments