anazalea / pySankey

create sankey diagrams with matplotlib
GNU General Public License v3.0
249 stars 95 forks source link

TypeError: 'module' object is not callable #21

Closed ahorvath closed 5 years ago

ahorvath commented 5 years ago

Can you help me, please?

Trying to run one the examples I got this error:

import pandas as pd from pySankey import sankey

df = pd.read_csv( ... 'goods.csv', sep=',', ... names=['id', 'customer', 'good', 'revenue'] ... )

df id customer good revenue 0 0 John fruit 5.5 1 1 Mike meat 11.0 2 2 Betty drinks 7.0 3 3 Ben fruit 4.0 4 4 Betty bread 2.0 5 5 John bread 2.5 6 6 John drinks 8.0 7 7 Ben bread 2.0 8 8 Mike bread 3.5 9 9 John meat 13.0

sankey(left=df['customer'], right=df['good'], rightWeight=df['revenue'], aspect=20,fontsize=20, figureName="customer-good") Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable

Pierre-Sassoulas commented 5 years ago

Probably a bad import caused by #18 . Temporary fix :

from pySankey.sankey import sankey

ahorvath commented 5 years ago

Thanks! It works with another quick fix: figureName -> figure_name

Bests, Attila