-
Notifications
You must be signed in to change notification settings - Fork 27
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
Error in tutorial : inconsistent TemporalNetwork.network type? #59
Comments
Nice catch! This is just an outdated tutorial. Thanks for flagging this. The issue here is that modifications were made to only use pandas arrays when the network/connections are sparse (I think if less than 25% of the connections are non-zero). This random network fills that criteria so it makes it a numpy array. So I am creating a little to do list for myself here:
|
That makes sense! Setting I'm guessing you made that choice to optimise the code in some way. |
It is a good point.
This behaviour is the an unfortunate trade-off I've had to make for wanting to be quick on small datasets and be able to cope with very large datasets. Trying to find one representation that is (1) familiar for a user to interact with (np or pd), (2) efficient for quick processing, (3) efficient for large networks, is something I hope to implement at one point. But for now, this was the best solution I could think of.. |
I sensed it would be something like this, it makes sense, thanks. Your point 1. should make it quite safe. In any case I don't have a better solution either, I jut got surprised because I even prob=0.3 yielded sometimes sparse and sometimes dense nets! |
Copy pasting the first few lines of the tutorial
https://teneto.readthedocs.io/en/latest/tutorial/networkrepresentation.html#temporalnetwork-object
yields an error at
tnet.network.head()
because tnet created withtnet.generatenetwork('rand_binomial',size=(5,3), prob=0.5)
is a Numpy
ndarray
and not a PandasDataFrame
.I haven't tried other ways of creating tnet, so I'm not sure if
tnet.network
is consistently a numpy array or not. If so, the tutorial should be updated, otherwise it should be made so thattnet.network
is always the same type: either numpy array or pandas DataFrame.The text was updated successfully, but these errors were encountered: