diff --git a/.travis.yml b/.travis.yml index 74f5533..0604074 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ addons: packages: - python3 - python3-pip + - python3-setuptools + - libhdf5-serial-dev before_install: - pip3 install --user --upgrade pip - pip --version diff --git a/src/Pandas.jl b/src/Pandas.jl index f857c09..7aa392e 100644 --- a/src/Pandas.jl +++ b/src/Pandas.jl @@ -313,6 +313,15 @@ function show(io::IO, df::PandasWrapped) println(io, s) end +function show(io::IO, ::MIME"text/html", df::PandasWrapped) + obj = df.pyo + try + return println(io, obj.to_html()) + catch + return show(io, df) + end +end + function query(df::DataFrame, s::AbstractString) pandas_wrap(py"$(df.pyo).query($s)"o) end diff --git a/test/runtests.jl b/test/runtests.jl index c7c3d84..fe717e6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,6 +8,11 @@ age[2] = 31 query(df, :(age!=27)) # Issue #26 +text = repr(MIME("text/html"), df) +@test text isa String +@test occursin("