I am working on an excel file with multiple sheets, This excel file has some common columns in every sheet and common rows which i want to remove. When I read the excel file, I am getting a dict variable. I tried to get values from the Dict and to store them into the Dataframe. But when I drop the columns from the dataframe something weird is happening they are not getting dropped and the values in the loop and outside the loop the daataframe only has one sheets data.
Below is what I have done.
Retriveing part
import pandas as pd
url1 = 'https:.............xlsx'
dict_url = pd.read_excel (url1,sheet_name = None)
Editing part, this is where i was trying to use drop() on dataframe but its not working
for key in dict_url.keys():
temp_df = pd.DataFrame(dict_url[key])
df2 = temp_df.drop(['Unnamed: 3', 'Unnamed: 4'], axis=1)
df3 = df2.drop([0,1])
finaldf= df3.drop(df3.tail(1).index,inplace=True)
if i don't use the for loop and do this instead it works
df = pd.DataFrame()
for key in dict_url.keys():
df = pd.DataFrame(dict_url[key])
print(df)
df2 = df.drop(['Unnamed: 3', 'Unnamed: 4'], axis=1)
df3 = df2.drop([0,1])
df4 = df3.drop(df3.tail(1).index,inplace=True)
print(df4)
What is it that i am missing