Reputation: 175
Output of the following code is: 0 A B C D
data = pd.read_csv("file")
print(data.loc[[0]].to_string(header=False ))
Which has 2 empty spaces between each variable. Why does it have 2 empty spaces? Is there a way that I can make it with one empty space between each cell(without for loop)?
Upvotes: 0
Views: 81
Reputation: 316
This might be a fast solution but it works. Try adding: .replace(' ',' ')
at the end of printed string.
Upvotes: 1