AttributeError: module 'networkx' has no attribute 'from_pandas_dataframe'

前端 未结 3 338
名媛妹妹
名媛妹妹 2021-01-07 16:40

I have networkx v. 2.1. to make it work w/ pandas dataframe, i tried following:

  • installed via pip3, this did not work generated
3条回答
  •  悲哀的现实
    2021-01-07 17:08

    In networkx 2.0 from_pandas_dataframe has been removed.

    Instead you can use from_pandas_edgelist.

    Then you'll have:

    g_data=G=nx.from_pandas_edgelist(x, 1, 2, edge_attr=True)
    

提交回复
热议问题