Python/Pandas TypeError: 'list' object is not callable

datetime, list, pandas, python

Solution

Looks like python thinks `pd.date_range` is a list and that you're trying to call it. You may have accidentally done something like this:

pd.date_range = []

Check to see what its type is

type(pd.date_range)

list

solution

Restart your kernel.

Problem

This is not a duplicate question, or at least I don't think so. When I try to run this code snippet of just two lines: ``` import pandas as pd mydates = pd.date_range('2010-01-22', '2010-01-26') ``` On trying the foll: ``` In [16]:import pandas as pd In [17]:mydates = pd.date_range('2010-01-22', '2010-01-26') Traceback (most recent call last): ``` I get the below error after trying on both 2.7 and 3.6 ``` File "<ipython-input-17-ef49b611e028>", line 1, in <module> mydates = pd.date_range('2010-01-22', '2010-01-26') TypeError: 'list' object is not callable ``` What am I doing wrong?

Original source