Closed kiview closed 3 years ago
Thanks.
Sorry it took a while to get this.
The fix is added in upcoming 0.5.3 release by adding df= df[['i', 'j', 't']] to TemporalNetwork (currently on master)
By doing this, the 4th possible column for weight is discarded (which breaks my code!) Could be replaced by
# Ensure order of columns
if len(df.colums)==4 :
df = df[['i', 'j', 't', 'weight']]
elif len(df.colums)==3 :
df = df[['i', 'j', 't']]
else :
print("Wrong number of columns in df")
I can submit a PR if you agree.
Sorry for breaking your code!
Sounds like a good suggestion. Feel free to submit it.
No worries, thanks for making Teneto! My own code with temporal networks is here in case you're interested: https://gitlab.com/habermann_lab/phasik
I submitted a PR fixing the two issues now.
If a
TemporalNetwork
object is generated from aDataFrame
that complies to the format (i, j, t
columns)there will be an
IndexError
when plotting aslice-plot
:This happens specifically if the column order is
t, i, j
. A workaround is changing the column order in theDataFrame
: