-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in any graph #27
Comments
Note that the dataframe required by Seaborn.jl is Run the official example in Julia 1.6.0: import Seaborn as sns
tips = sns.load_dataset("tips")
typeof(tips) # Pandas.DataFrame
sns.boxplot(x="day", y="total_bill", data=tips) |
@ShuhuaGao is right. I would support a feature that autoconverts the input to Seaborn functions from |
julia> using DataFrames
julia> import Pandas as pd
julia> jdf = DataFrame(x=[1, 2], y=[2.3, -1]);
julia> pd.DataFrame(jdf) # to Pandas.DataFrame
y x
0 2.3 1
1 -1.0 2 |
Thanks to everyone |
For any graph I try to use, I get errors. For example, trying to use a catplot I get:
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/egolep/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError("'PyCall.jlwrap' object is not subscriptable")
File "/home/egolep/.local/lib/python3.9/site-packages/seaborn/_decorators.py", line 46, in inner_f
return f(**kwargs)
File "/home/egolep/.local/lib/python3.9/site-packages/seaborn/regression.py", line 605, in lmplot
data = data[cols]
Stacktrace:
[1] pyerr_check
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:62 [inlined]
[2] pyerr_check
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:66 [inlined]
[3] _handle_error(msg::String)
@ PyCall ~/.julia/packages/PyCall/BD546/src/exception.jl:83
[4] macro expansion
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:97 [inlined]
[5] #107
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 [inlined]
[6] disable_sigint
@ ./c.jl:458 [inlined]
[7] __pycall!
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:42 [inlined]
[8] _pycall!(ret::PyObject, o::PyObject, args::Tuple{}, nargs::Int64, kw::PyObject)
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:29
[9] _pycall!
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:11 [inlined]
[10] (::PyObject)(; kwargs::Base.Iterators.Pairs{Symbol, DataFrames.DataFrame, Tuple{Symbol}, NamedTuple{(:data,), Tuple{DataFrames.DataFrame}}})
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:86
[11] lmplot(; kwargs::Base.Iterators.Pairs{Symbol, DataFrames.DataFrame, Tuple{Symbol}, NamedTuple{(:data,), Tuple{DataFrames.DataFrame}}})
@ Seaborn ~/.julia/packages/Seaborn/vfmph/src/Seaborn.jl:61
[12] top-level scope
@ REPL[53]:1
Or for a lmplot I get:
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/egolep/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError("'PyCall.jlwrap' object is not subscriptable")
File "/home/egolep/.local/lib/python3.9/site-packages/seaborn/_decorators.py", line 46, in inner_f
return f(**kwargs)
File "/home/egolep/.local/lib/python3.9/site-packages/seaborn/regression.py", line 605, in lmplot
data = data[cols]
Stacktrace:
[1] pyerr_check
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:62 [inlined]
[2] pyerr_check
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:66 [inlined]
[3] _handle_error(msg::String)
@ PyCall ~/.julia/packages/PyCall/BD546/src/exception.jl:83
[4] macro expansion
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:97 [inlined]
[5] #107
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 [inlined]
[6] disable_sigint
@ ./c.jl:458 [inlined]
[7] __pycall!
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:42 [inlined]
[8] _pycall!(ret::PyObject, o::PyObject, args::Tuple{}, nargs::Int64, kw::PyObject)
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:29
[9] pycall!(ret::PyObject, o::PyObject, args::Tuple{}, kwargs::Base.Iterators.Pairs{Symbol, Any, NTuple{7, Symbol}, NamedTuple{(:x, :y, :hue, :col, :data, :col_wrap, :height), Tuple{String, String, String, String, DataFrames.DataFrame, Int64, Int64}}})
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:11
[10] ##114
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:86 [inlined]
[11] lmplot(; kwargs::Base.Iterators.Pairs{Symbol, Any, NTuple{7, Symbol}, NamedTuple{(:x, :y, :hue, :col, :data, :col_wrap, :height), Tuple{String, String, String, String, DataFrames.DataFrame, Int64, Int64}}})
@ Seaborn ~/.julia/packages/Seaborn/vfmph/src/Seaborn.jl:61
[12] top-level scope
@ REPL[56]:1
Is it a problem with my version o Python? I also tried to use PyCall with Conda instead of my system version of Python, but with no difference (I don't also know if Seaborn.jl actually uses PyCall)
The text was updated successfully, but these errors were encountered: