'””” invalid syntax Spyder 3.9 [closed]
I wrote code to open excel file:
import pandas as pd
df= pd.read_excel(r'C:\Users\vipak\Desktop\UE\python1.1.xlsx',sheet_name=’Sheet2’,header=1,)
print (df)
Firsty, when I done this everything was ok. Another time when I've opened Spyder, I received information that """< is invalid sytntax. I also tried to wrote this code without r' or add extra , but nothing works. I checked and any of my excel file working by this command.
Solution 1:[1]
you need to use apostrophe for string , sheet_name is using air comma:
import pandas as pd
df= pd.read_excel(r'C:\Users\vipak\Desktop\UE\python1.1.xlsx',sheet_name='Sheet2',header=1,)
print (df)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | eshirvana |
