Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ addons:
packages:
- python3
- python3-pip
- python3-setuptools
- libhdf5-serial-dev
before_install:
- pip3 install --user --upgrade pip
- pip --version
Expand Down
9 changes: 9 additions & 0 deletions src/Pandas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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("<table", text)
@test occursin("age", text)

df = read_csv(joinpath(dirname(@__FILE__), "test.csv"))
typeof(df)
@test isa(df, Pandas.DataFrame)
Expand Down