@@ -305,49 +305,3 @@ def test_malformed_skipfooter(python_parser_only):
305305 msg = "Expected 3 fields in line 4, saw 5"
306306 with pytest .raises (ParserError , match = msg ):
307307 parser .read_csv (StringIO (data ), header = 1 , comment = "#" , skipfooter = 1 )
308-
309-
310- @pytest .mark .parametrize ("thousands" , [None , "." ])
311- @pytest .mark .parametrize (
312- "value, result_value" ,
313- [
314- ("1,2" , 1.2 ),
315- ("1,2e-1" , 0.12 ),
316- ("1,2E-1" , 0.12 ),
317- ("1,2e-10" , 0.0000000012 ),
318- ("1,2e1" , 12.0 ),
319- ("1,2E1" , 12.0 ),
320- ("-1,2e-1" , - 0.12 ),
321- ("0,2" , 0.2 ),
322- (",2" , 0.2 ),
323- ],
324- )
325- def test_decimal_and_exponential (python_parser_only , thousands , value , result_value ):
326- # GH#31920
327- data = StringIO (
328- f"""a b
329- 1,1 { value }
330- """
331- )
332- result = python_parser_only .read_csv (
333- data , "\t " , decimal = "," , engine = "python" , thousands = thousands
334- )
335- expected = DataFrame ({"a" : [1.1 ], "b" : [result_value ]})
336- tm .assert_frame_equal (result , expected )
337-
338-
339- @pytest .mark .parametrize ("thousands" , [None , "." ])
340- @pytest .mark .parametrize (
341- "value" ,
342- ["e11,2" , "1e11,2" , "1,2,2" , "1,2.1" , "1,2e-10e1" , "--1,2" , "1a.2,1" , "1..2,3" ],
343- )
344- def test_decimal_and_exponential_erroneous (python_parser_only , thousands , value ):
345- # GH#31920
346- data = StringIO (
347- f"""a b
348- 1,1 { value }
349- """
350- )
351- result = python_parser_only .read_csv (data , "\t " , decimal = "," , thousands = thousands )
352- expected = DataFrame ({"a" : [1.1 ], "b" : [value ]})
353- tm .assert_frame_equal (result , expected )
0 commit comments