I'm looking for a solution to drop column index in my code. Any help would be greatly appreciated. Thank you.
from tkinter import *
from tkinter.ttk import *
import tkinter as tk
import pandas as pd
from tkinter import ttk
#create window
window = tk.Tk()
window.title("Basic H/W status reporting")
window.geometry("750x600")
window.configure(bg='white')
df = pd.read_excel ('C:/Users/sgtiocqn/Desktop/females.xlsm', sheet_name= 'females')
df1 = pd.DataFrame(df, columns=["region"])
df1.drop(labels=None, columns="region", level=None, inplace=False, errors='raise')
print(df1)
window.mainloop()
This is how the result looks like now (using the code above) -
What I'm trying to get -
ATTEMPTS I have tried using .to_numpy() and this is the messy result...
Also, when I'm trying to continue from numpy code, I can't drop duplicates/sort values using df.drop/df.drop_duplicates/df.sort_values.
Error received(e.g.):
AttributeError: 'numpy.ndarray' object has no attribute 'drop_duplicates'