Skip to content

Commit

Permalink
Merge pull request nipy#193 from Xunius/fix_granger_nan
Browse files Browse the repository at this point in the history
fix all nans in GrangerAnalyzer
  • Loading branch information
arokem authored Sep 28, 2021
2 parents 16eaab6 + 4d2131f commit 8b83797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/examples/multi_taper_coh.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"""

for i in range(nseq):
for j in range(i):
for j in range(i, nseq):

"""
Expand Down
8 changes: 5 additions & 3 deletions nitime/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import matplotlib.axis as ax
ax.munits = mpl_units

from nitime.utils import triu_indices
from nitime.utils import tril_indices

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

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

# Extract the minimum and maximum values for scaling of the
# colormap/colorbar:
Expand Down

0 comments on commit 8b83797

Please sign in to comment.