@@ -77,6 +77,19 @@ describe("Generic (NDFrame)", function () {
7777 "IndexError: Row index must contain unique values"
7878 } ) ;
7979 } ) ;
80+
81+ it ( "Successfully create a 2D Frame when first value is empty" , function ( ) {
82+ let data = [ [ null , 20 , 1 ] , [ 20 , 25 , 3 ] ] ;
83+ let ndframe = new NDframe ( { data, isSeries : false } ) ;
84+ //@ts -ignore
85+ assert . deepEqual ( ndframe . values , data ) ;
86+ } ) ;
87+ it ( "Successfully create a 1D Frame when first value is empty" , function ( ) {
88+ let data = [ null , 'bval2' , 'bval3' , 'bval4' ] ;
89+ let ndframe = new NDframe ( { data, isSeries : true } ) ;
90+ //@ts -ignore
91+ assert . deepEqual ( ndframe . values , data ) ;
92+ } ) ;
8093 } )
8194
8295 describe ( "NDframe Created from JavaScript Object" , function ( ) {
@@ -123,70 +136,6 @@ describe("Generic (NDFrame)", function () {
123136 let ndframe = new NDframe ( { data, isSeries : false } ) ;
124137 assert . deepEqual ( ndframe . values as any , [ [ "A" , NaN ] , [ NaN , 2 ] ] ) ;
125138 } ) ;
126- // it("NDframe created from json takes key position into consideration", function () {
127- // let json_data = [{ A: "A", B: "B", C: "C" },
128- // { A: "A", B: "B", C: "C" },
129- // { C: "C", B: "B", A: "A" },
130- // { A: "A", C: "C", B: "B" }];
131-
132- // let output = [
133- // [
134- // 'A',
135- // 'B',
136- // 'C'
137- // ],
138- // [
139- // 'A',
140- // 'B',
141- // 'C'
142- // ],
143- // [
144- // 'A',
145- // 'B',
146- // 'C'
147- // ],
148- // [
149- // 'A',
150- // 'B',
151- // 'C'
152- // ]
153- // ];
154- // let ndframe = new NDframe({ data: json_data, isSeries: false });
155- // assert.deepEqual(ndframe.values, output);
156- // });
157-
158- // it("NDframe created from json sets value to NaN if not present", function () {
159- // let json_data = [{ A: "A", B: "B", C: "C" },
160- // { A: "A", B: "B", C: "C" },
161- // { C: "C", B: "B", A: "A" },
162- // { A: "A", C: "C" }];
163-
164- // let output = [
165- // [
166- // 'A',
167- // 'B',
168- // 'C'
169- // ],
170- // [
171- // 'A',
172- // 'B',
173- // 'C'
174- // ],
175- // [
176- // 'A',
177- // 'B',
178- // 'C'
179- // ],
180- // [
181- // 'A',
182- // 'B',
183- // NaN
184- // ]
185- // ];
186- // let ndframe = new NDframe({ data: json_data, isSeries: false });
187- // assert.deepEqual(ndframe.values, output);
188- // });
189-
190139 } ) ;
191140
192141 describe ( "Replacing row data" , function ( ) {
0 commit comments