I am trying to run grangercausalitytests on two time series:
import numpy as np
import pandas as pd
from statsmodels.tsa.stattools import grang
Another thing to keep an eye out for is duplicate columns. Duplicate columns will have a correlation score of 1.0, resulting in singularity. Otherwise, it's also possible you have 2 features that are perfectly correlated. And easy way to check this is with df.corr(), and look for pairs of columns with correlation = 1.0.