2

Attempting to convert a single dataframe column into a row. I've seen multiple responses to similar questions, but most of the questions pertain to multiple columns and rows. I can't find the simple solution to converting the following:

    value
0   A   
1   B  
2   C  
3   D  
4   E  
5   F  
6   G  
7   H  
8   I  
9   J  
10  K  
11  L

To

A B C D E F G H I J K L
4
  • Is that supposed to be a row with N columns... or a space delimited string? Commented Sep 2, 2016 at 20:32
  • Are you looking for transpose? Commented Sep 2, 2016 at 20:32
  • Might be using transpose wrong, but yes ideally that would be it. I get the following error: TypeError: transpose() takes exactly 1 argument (2 given) Commented Sep 2, 2016 at 20:45
  • Can you post how you use transpose? Commented Sep 2, 2016 at 20:46

1 Answer 1

4

To transpose the value dataframe

value1 = value.transpose()

Sign up to request clarification or add additional context in comments.

2 Comments

Or, the commonly used value.T.
This is all I needed. Thanks much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.