Skip to content
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

Note need to restart jupyter after installation in README #31

Open
asoliverez opened this issue Apr 24, 2018 · 7 comments
Open

Note need to restart jupyter after installation in README #31

asoliverez opened this issue Apr 24, 2018 · 7 comments

Comments

@asoliverez
Copy link

I have a pandas dataframe, and I'm trying to get a sankey diagram out of it.

Here's the excerpt of code, copied mostly from the quickstart tutorial.

from ipysankeywidget import SankeyWidget
from floweaver import *
import pandas as pd

flowDf = lostWonDf.sort_values(['LeadSource','WonCount'], ascending=[True,False]).groupby(['LeadSource','WonCount','Type'], sort=False).agg({
    'AmountGBP':'sum'
}).reset_index()
flowDf.rename(columns={'LeadSource':'source','AmountGBP':'value','Type':'type'}, inplace=True)
flowDf['target'] = flowDf.WonCount.apply(lambda x: 'Won' if x == 1 else 'Lost')
flowDf.drop('WonCount', axis=1, inplace=True)

SankeyWidget(links=flowDf.to_dict('records'))

I get this error when I run the cell.


TypeError Traceback (most recent call last)
in ()
13 #.unstack().reset_index().set_index('LeadSource')
14
---> 15 SankeyWidget(links=flowDf.to_dict('records'))
16
17 size = dict(width=570, height=300)

TypeError: wrap() got an unexpected keyword argument 'links'

@asoliverez
Copy link
Author

It was an install error. After restarting jupyter, it worked fine.

@ricklupton
Copy link
Owner

Great, glad it's working now. If there's anything that was missing from the instructions that would have made it easier to get started then let us know.

@asoliverez
Copy link
Author

The examples and tutorials are great. This particular issue hit me because I had to restart jupyter to get it working.
Might be worth adding a note to restart it after installing the extension

@ricklupton
Copy link
Owner

Thanks for the feedback. If you'd like to, it'd be great if you want to add a note yourself! You can edit the README.md file and add something, probably just where it says "To get started, open the quickstart tutorial in Jupyter notebook and step through the notebook cells to produce the fruit example shown above.". Any questions let me know.

@ricklupton
Copy link
Owner

Reopening as an easy first contribution to the README. If anyone would like to get involved, this would be a great way to get started.

  1. Fork the repository as described in CONTRIBUTING.md
  2. Add some text to the README file as noted above. Something like "Note: you may have to restart jupyter after installing the extensions before they can be used in the notebook." You can do this on your own computer and commit & push using git, or do it on Github directly using the ✏️ icon.
  3. Open a pull request as described in CONTRIBUTING.md

Any questions let us know by commenting below. 😃

@ricklupton ricklupton reopened this May 9, 2018
@ricklupton ricklupton changed the title wrap() got an unexpected keyword argument 'links' Note need to restart jupyter after installation in README May 9, 2018
@eyaltrabelsi
Copy link

@ricklupton I would love to tackle this :)

@ricklupton
Copy link
Owner

@eyaltrabelsi Welcome, please have a go! :)

Do ask If you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants