Exception Handling in Pandas

8 views
Skip to first unread message

Rohit Gupta

unread,
Aug 4, 2018, 10:34:14 AM8/4/18
to PANDA Project Users
Hi Team,
I am trying to pass a csv  and Excel file in Pandas . In case the file not found or wrong path what type of Error it should throw.

Below is my problem code. After Except what should i write.
try:
    file = 'Data1_problem.xlsx'
    df = pd.read_excel(file)
    print(df.head())
    print(df.info())
    print (df.describe())
    lines = df.plot.line()
except:
    print("Oops!  No file found")

Justin Myers

unread,
Aug 4, 2018, 1:36:30 PM8/4/18
to panda-pro...@googlegroups.com
Hi! This list is for PANDA, a web application for data journalists: http://pandaproject.net/

For pandas, the analysis library, you might want to try one of the links here: http://pandas.pydata.org/community.html
-Justin
--
You received this message because you are subscribed to the Google Groups "PANDA Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to panda-project-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages