Python Forum

Full Version: Error Message -
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
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