How do I solve this error from my code KeyError Date Adj Close not found in axis

0 votes

#import libraries:
import numpy as np
import streamlit as st
import matplotlib.pyplot as plt
import pandas_datareader as data
from keras.models import load_model

start = '2010-01-01'
end = '2021-08-20'

df = data.DataReader('CENTUM.NS', 'yahoo', start, end)
df.head()

df.tail()

df = df.reset_index()
df.head()

df=df.drop(['Date','Adj Close',],axis = 1)
df.head()

#I am getting the following error:
KeyError: "['Date', Adj Close',] not found in axis"



Aug 26, 2021 in Machine Learning by anonymous

edited Mar 4, 2025 435 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP