Skip to content

Commit 8b83797

Browse files
authored
Merge pull request #193 from Xunius/fix_granger_nan
fix all nans in GrangerAnalyzer
2 parents 16eaab6 + 4d2131f commit 8b83797

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/examples/multi_taper_coh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"""
153153

154154
for i in range(nseq):
155-
for j in range(i):
155+
for j in range(i, nseq):
156156

157157
"""
158158

nitime/viz.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import matplotlib.axis as ax
3131
ax.munits = mpl_units
3232

33-
from nitime.utils import triu_indices
33+
from nitime.utils import tril_indices
3434

3535
#Some visualization functions require networkx. Import that if possible:
3636
try:
@@ -272,10 +272,12 @@ def channel_formatter(x, pos=None):
272272
# data provided
273273
m = in_m.copy()
274274

275-
# Null the upper triangle, so that you don't get the redundant and the
275+
# Null the **lower** triangle, so that you don't get the redundant and the
276276
# diagonal values:
277-
idx_null = triu_indices(m.shape[0])
277+
idx_null = tril_indices(m.shape[0])
278278
m[idx_null] = np.nan
279+
# tranpose the upper triangle to lower
280+
m = m.T
279281

280282
# Extract the minimum and maximum values for scaling of the
281283
# colormap/colorbar:

0 commit comments

Comments
 (0)