d3py icon indicating copy to clipboard operation
d3py copied to clipboard

AttributeError: 'module' object has no attribute 'Figure'

Open sloria opened this issue 12 years ago • 4 comments

I get the following error when running the example code in the README:

File "d3py.py", line 1, in <module>
    import d3py
  File "/Users/sloria1/projects/sandbox/d3py.py", line 15, in <module>
    fig = d3py.Figure(df, name="basic_example", width=300, height=300) 
AttributeError: 'module' object has no attribute 'Figure'

From the README:

import d3py
import pandas
import numpy as np

# some test data
T = 100
# this is a data frame with three columns (we only use 2)
df = pandas.DataFrame({
    "time" : range(T),
    "pressure": np.random.rand(T),
    "temp" : np.random.rand(T)
})
## build up a figure, ggplot2 style
# instantiate the figure object
fig = d3py.Figure(df, name="basic_example", width=300, height=300) 
# add some red points
fig += d3py.geoms.Point(x="pressure", y="temp", fill="red")
# writes 3 files, starts up a server, then draws some beautiful points in Chrome
fig.show()

sloria avatar Nov 27 '12 08:11 sloria

Hello! I think I've fixed this. Sorry for the problem. I've updated the code and the example, so now you should use the PandasFigure instead of a straight Figure object to make the plot. If you'd be so kind, please check out the new master branch of the code, install it and see if you can get the README.md example running and also the examples in the example folder.

Thanks so much for logging the issue! Please do shout if there are any problems. I'd like this to at least be installable and for the basic examples to work.

mikedewar avatar Dec 27 '12 20:12 mikedewar

@mikedewar I also meet this problem. And have do like you said, but it didn't work. File "/home/qy/python/d3py.py", line 15, in fig = d3py.PandasFigure(df, name="basic_example", width=300, height=300) AttributeError: 'module' object has no attribute 'PandasFigure'

qiuyi116 avatar Dec 06 '14 09:12 qiuyi116

is this still an open issue? How far d3py has come along since, any alternatives/suggestions? do you see it being integrated into pandas anytime soon? http://pandas.pydata.org/developers.html#development-roadmap

rohansb avatar Mar 12 '17 22:03 rohansb

the story ended a while ago, as described in the README. I'm not sure how the pandas guys intend to think about plotting, but the ggplot-based idiom described in this project still seems pretty good!

mikedewar avatar Mar 15 '17 14:03 mikedewar