@@ -612,7 +612,8 @@ def _expand_elements(body):
612
612
613
613
614
614
def _data_to_frame (data , header , index_col , skiprows ,
615
- parse_dates , tupleize_cols , thousands ):
615
+ parse_dates , tupleize_cols , thousands ,
616
+ decimal ):
616
617
head , body , foot = data
617
618
618
619
if head :
@@ -630,7 +631,7 @@ def _data_to_frame(data, header, index_col, skiprows,
630
631
tp = TextParser (body , header = header , index_col = index_col ,
631
632
skiprows = _get_skiprows (skiprows ),
632
633
parse_dates = parse_dates , tupleize_cols = tupleize_cols ,
633
- thousands = thousands )
634
+ thousands = thousands , decimal = decimal )
634
635
df = tp .read ()
635
636
return df
636
637
@@ -716,7 +717,8 @@ def _validate_flavor(flavor):
716
717
717
718
718
719
def _parse (flavor , io , match , header , index_col , skiprows ,
719
- parse_dates , tupleize_cols , thousands , attrs , encoding ):
720
+ parse_dates , tupleize_cols , thousands , attrs , encoding ,
721
+ decimal ):
720
722
flavor = _validate_flavor (flavor )
721
723
compiled_match = re .compile (match ) # you can pass a compiled regex here
722
724
@@ -744,15 +746,18 @@ def _parse(flavor, io, match, header, index_col, skiprows,
744
746
skiprows = skiprows ,
745
747
parse_dates = parse_dates ,
746
748
tupleize_cols = tupleize_cols ,
747
- thousands = thousands ))
749
+ thousands = thousands ,
750
+ decimal = decimal
751
+ ))
748
752
except EmptyDataError : # empty table
749
753
continue
750
754
return ret
751
755
752
756
753
757
def read_html (io , match = '.+' , flavor = None , header = None , index_col = None ,
754
758
skiprows = None , attrs = None , parse_dates = False ,
755
- tupleize_cols = False , thousands = ',' , encoding = None ):
759
+ tupleize_cols = False , thousands = ',' , encoding = None ,
760
+ decimal = '.' ):
756
761
r"""Read HTML tables into a ``list`` of ``DataFrame`` objects.
757
762
758
763
Parameters
@@ -828,6 +833,12 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None,
828
833
underlying parser library (e.g., the parser library will try to use
829
834
the encoding provided by the document).
830
835
836
+ decimal : str, default '.'
837
+ Character to recognize as decimal point (e.g. use ',' for European
838
+ data).
839
+
840
+ .. versionadded:: 0.18.2
841
+
831
842
Returns
832
843
-------
833
844
dfs : list of DataFrames
@@ -871,4 +882,5 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None,
871
882
'data (you passed a negative value)' )
872
883
_validate_header_arg (header )
873
884
return _parse (flavor , io , match , header , index_col , skiprows ,
874
- parse_dates , tupleize_cols , thousands , attrs , encoding )
885
+ parse_dates , tupleize_cols , thousands , attrs , encoding ,
886
+ decimal )
0 commit comments