Printing a data.frame without index - Python

0 votes

I have this Employee data.frame:

    Names    Designation
0    Raj         CTO
1   Rohit       Developer
2    Sam         CFO
3    Ane         CEO

I would want to print this data.frame without the index values, how can i do it?

May 17, 2018 in Data Analytics by nirvana
• 3,060 points
17,049 views
df.style.hide_index()

should do the trick
Hey thanks for sharing this trick. It really worked.

4 answers to this question.

0 votes

You can convert the data-frame to a string and say index=False.

Below is the command:

print(Employee.to_string(index=False))
Names Designation
  Raj         CTO
Rohit   Developer
  Sam         CFO
  Ane         CEO
answered May 17, 2018 by Bharani
• 4,550 points
0 votes

Data Frame has a property named "index" which is set to true by default. If you want to print values without index then you have to set this property to false. 

print (df.to_string(index = False))

answered Dec 10, 2018 by Hari
0 votes
import pandas

d = ['a','b','c','d','e']
df = pandas.DataFrame(data=d)
print (df.to_string(index = False))

Output:

0
a
b
c
d
e
answered Dec 10, 2018 by Sarajit
+1 vote
.tolist() function will remove index
answered Mar 11 by nishant thakur

Related Questions In Data Analytics

+1 vote
2 answers
0 votes
1 answer
+1 vote
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,720 points
124 views
0 votes
1 answer

How to spilt a column of a data frame into multiple columns

it is easily achievable by using "stringr" ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
105 views
0 votes
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21 in Data Analytics by anonymous
• 31,840 points
146 views
0 votes
2 answers

How to change column names of a Data frame?

Try this way - names(data frame) <- ...READ MORE

answered Aug 26 in Data Analytics by anonymous
• 31,840 points
90 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Need help with making use of Pluck in Python

Hi, good question. Easy solution to be ...READ MORE

answered Jan 24 in Python by Nymeria
• 3,520 points
124 views