I have a dataframe row and want to get it as a string of just the values, no columns.
col1 | col2 | col3
-----------------
1 | 2 | 3
x | y | z
I'd like to be able to select just one row and have it as a string like:
'1','2','3'
But I keep getting the column names still in there, or lots of other values like:
"['1' '2'\n '3']"
just use
df.iloc[1,:].to_string(header=False, index=False)
header = False --> don't include column names in the output string
index = False --> don't include row index in the output string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With