NetworkxD3 icon indicating copy to clipboard operation
NetworkxD3 copied to clipboard

PandasError: DataFrame constructor not properly called!

Open Werner0 opened this issue 7 years ago • 1 comments

I had to downgrade to Pandas 0.19.1 due to another error. Now I get the following error. Please provide the package versions you used:

import networkx as nx
from NetworkxD3.NetworkxD3 import simpleNetworkx
from IPython.display import IFrame 

G = nx.Graph()
H = ["A","B","C","D","E","F","G", "H","I","J"]
G.add_nodes_from(H)
G.add_edges_from([("A","B"), ("A","C"), ("A","D"), ("A","J"), ("B","E"), ("B","F"),
("C","G"),("C","H"), ("D","I")])

simpleNetworkx(G)
IFrame('Net.html', width=400, height=400)

PandasError Traceback (most recent call last) in () 9 ("C","G"),("C","H"), ("D","I")]) 10 ---> 11 simpleNetworkx(G) 12 IFrame('Net.html', width=400, height=400)

/vagrant/JMB/NetworkxD3/NetworkxD3/NetworkxD3.py in simpleNetworkx(G) 49 ro.r('rdf=data.frame()') 50 ---> 51 df = p.DataFrame(G.edges()) 52 53 df_r = com.convert_to_r_dataframe(df)

~/anaconda3/envs/normal/lib/python3.6/site-packages/pandas/core/frame.py in init(self, data, index, columns, dtype, copy) 343 copy=False) 344 else: --> 345 raise PandasError('DataFrame constructor not properly called!') 346 347 NDFrame.init(self, mgr, fastpath=True)

PandasError: DataFrame constructor not properly called!

Werner0 avatar Jan 17 '18 06:01 Werner0