Computer Science, asked by nisha930630, 8 months ago

to get the transpose of a data frame D1you can write
1. D1
2.D1.Tanspose.
3. D1.Swap​

Answers

Answered by poojan
6

To get the transpose of a Data frame D1, we can write D1.transpose() (Option 2)

Explanation:

  • The dataframename.transpose() function is used to interchange the rows with columns data and vice versa.
  • The transpose function can be loaded from the 'pandas' library.
  • The function can contain the attributes copy, args*, kwargs*
  • The other representation of the function dataframename.transpose() is simply, dataframename.T

Creating a data frame D1

D = {'Name': ['Shonty', 'Poplu'],

     'Score': [150, 190],

     'YouTubers': [False, True],

     'SNSfollowers': ['15M', '10M']}

D1 = pd.DataFrame(data=D)

D1

                Name        Score        YouTubers       SNSfollowers

--------------------------------------------------------------------------------------

   0         Shonty          150             False                 15M

   1           Poplu           190             True                   10M

Transposing the data frame D1:

D1_transposed = D1.transpose()    # or we can use D1.T

D1_transposed

                                 0              1          

------------------------------------------------------

Name                    Shonty        Poplu

Score                     150             190

YouTubers             False          True

SNSfollowers        15M            10M

Learn more:

1. Using the data given, find the output on executing the following MySQL statement? SELECT DISTINICT (cust_id) FROM account; ...

https://brainly.in/question/24513542

2. Write SQL commands for the given data basis of FAMILY relation...

https://brainly.in/question/15115256

3. What are the maximum and the minimum number of rows returned by the R1 right outer join R2?

brainly.in/question/21195376

Answered by gauravgupta1321
0

Answer:

D.1

Explanation:

to get the transpose of a data frame D1 we can write D.1

Similar questions