Code Sample, a copy-pastable example if possible
def baselink():
return 'http://www2.aneel.gov.br/aplicacoes/capacidadebrasil/GeracaoTipoFase.asp'
formdata={
'tipo':'0',
'fase':'3'
}
import requests
session = requests.Session()
r=session.post(baselink(),data=formdata)
a=pd.read_html(r.text,thousands='.',decimal=',',na_values=['-'],flavor='html5lib')
test=a[1]
Problem description
The code above will interpret a cell value of "1.401,40" as a numeric type (float) 140140.0, when it should be 1401.40. I am using pandas 0.19.0. I tried with both flavor='html5lib' and flavor=None.
Expected Output
The string "1.401,40" should be interpreted as (float) 1401.40.
Output of pd.show_versions()
# Paste the output here pd.show_versions() here
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None
pandas: 0.19.0
nose: 1.3.7
pip: 8.1.2
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.2
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: 1.1.0
tables: None
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.4.0
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: 3.6.4
bs4: 4.5.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: 1.1.4
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.42.0
pandas_datareader: None
Comment From: pedrovgp
My mistake, I was re-converting in a later step.