TypeError : ‘method’ object is not subscriptable .to_csv is a function/method, and you can’t use [] after it, it must be (). So the code should be: