I am getting an Indentation error,while executing below code.
import pyodbc
import shutil
import pandas as pd
import numpy as np
def My_function():
data = pd.read_excel(r'my excel path')
dataincsv = data.to_csv(r'export into my csv path',sep=r'|')
cnxn = pyodbc.connect('''connection string''')
stmt1 = """Select column 1 from mytable"""
try:
Out_service = pd.read_sql(stmt1,cnxn)
except:
print("File format might be wrong,check the error")
else:
print(Out_service)
exit()
Getting below error when i run the code
line 14 try: ^ IndentationError: unexpected indent