I've created a DataFrame and getting index in output. I'm unable to find a way to hide these index in the output.
def create_dataframe(k,v):
a= pd.DataFrame(v, columns=k)
return a
k = ["Employee ID", "Name", "Salary"]
v = [["1446","Ashish", "80"],["1447","Priya", "70"], ["1448","Riya", "90"]]
create_dataframe(k,v)
Output:
Employee ID Name Salary
0 1446 Ashish 80
1 1447 Priya 70
2 1448 Riya 90
I can use a.style.hide_index()
, however, with that my DataFrame will be changed to a "Styler" object and I don't want that.
index=False
doesn't work either.
Can someone please check to point the issue and explain by correcting the code?