Python Forum
Error Message - - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Error Message - (/thread-18624.html)



Error Message - - Akainu - May-24-2019

Hi,

I have just completed my python with finance coding, but unfortunately, there is an error. I tried so many times to solve the issue, hope you will help me. thanks a lot

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

Data = pd.read_csv('C:/DATA.csv', parse_dates=['Date'], dayfirst=True, index_col=['Date'])
Date = Data.index


Error:
Data = pd.read_csv('C:/DATA.csv', parse_dates=['Date'], dayfirst=True, index_col=['Date']) Date = Data.index Traceback (most recent call last): File "<ipython-input-1-a51606cd14f8>", line 1, in <module> Data = pd.read_csv('C:/DATA.csv', parse_dates=['Date'], dayfirst=True, index_col=['Date']) NameError: name 'pd' is not defined



RE: Error Message - - Yoriz - May-24-2019

The error does not match the code shown.
The code has
Data = pd.read_csv('C:/DATA.csv', parse_dates=['Date'], dayfirst=True, index_col=['Date'])
on line 5 , the error says its on line 1, the error code has not imported pandas as pd.


RE: Error Message - - Akainu - May-24-2019

Hi, Thanks for your reply.
the Problem was at the execution of the code.
May I send you the entire code as MP?
Many thanks