LankyCyril / pyvenn

Python module for plotting Venn diagrams of 2..6 sets
https://pypi.org/project/venn
GNU General Public License v3.0
120 stars 27 forks source link

Error message #27

Closed skriv4 closed 1 year ago

skriv4 commented 1 year ago

Trying to run this in PyCharm. Says "NameError: name 'venn' is not defined." All packages seem to be installed. Also, I am new at python so I am unsure of some things, but how can I run my own data in this code?

LankyCyril commented 1 year ago

Did you import it? from venn import venn?

If yes and it still doesn't work, please provide a minimal example where it fails.

skriv4 commented 1 year ago

I was able to fix the error and now the code runs fine. However, how can I input my own data into this code?

LankyCyril commented 1 year ago

Yes, you can use your own data with pyvenn. Anything like this should work: venn({"Set1": {"A", "B", "C"}, "Set2": {"B", "C", "D"}})

The question on how to input your own data is a general Python programming issue that does not depend on pyvenn. By your own admission, you are new to Python, so a couple of general pointers here would be: pyvenn plots data that is passed as a dictionary of sets. In the example above "Set1" and "Set2" are dictionary keys, and {"A", "B", "C"} etc are dictionary values, which are in this case sets.

As the original question that pertained to the library, pyvenn, was resolved, I will be closing this issue.