-2

I keep getting:

File "app.py", line 59
df = pd.DataFrame(list(db.mycol.find({}))), inconsistent use of tabs and spaces in indentation

I don't know what's causing the problem. I already tried to detab it. I'm using sublime text. Any advice?

def gen_wind_speed(interval):
    now = dt.datetime.now()
    sec = now.second
    minute = now.minute
    hour = now.hour

    total_time = (hour * 3600) + (minute * 60) + (sec)
    client = MongoClient(port=27017)

    db = client.one
    mycol = client['coll']

    df = pd.DataFrame(list(db.mycol.find({})))
Filip Młynarski
  • 3,534
  • 1
  • 10
  • 22
Jack022
  • 867
  • 6
  • 30
  • 91

1 Answers1

1

As the error suggests, and I that think you understand, somewhere there is an inconsistent use of tabs and spaces. The line that you are getting an error on doesn't always mean that the error is happening on that line. The tab/space error could be anywhere above it.

If you've already redone all the spacing in this function to 4 spaces, as is the holy commandment, I would look above this function definition. Worst case, you have to use the search tool to find the tabs.

GranolaGuy
  • 133
  • 12