Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:26:02+00:00 2026-05-30T00:26:02+00:00

This is Pandas dataframe I want to convert 1D data into 2D array form

  • 0

This is Pandas dataframe
I want to convert 1D data into 2D array form

How do I convert from

  'A'  'B'  'C'
1  10   11   a  
2  10   12   b
3  10   13   c 
4  20   11   d  
5  20   12   e
6  20   13   f

to this 2d array as the following

   11 12 13
10  a  b  c 
20  d  e  f
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:26:05+00:00Added an answer on May 30, 2026 at 12:26 am
    >>> df.pivot('A', 'B', 'C')
      B  11  12  13
    A              
    10   a   b   c 
    20   d   e   f 
    

    Where df is:

    >>> df = DataFrame(dict(A=[10]*3+[20]*3, B=range(11, 14)*2, C=list('abcdef')))
    >>> df
       A   B   C
    0  10  11  a
    1  10  12  b
    2  10  13  c
    3  20  11  d
    4  20  12  e
    5  20  13  f
    

    See Reshaping and Pivot Tables

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is what I want to do. I have an array. $arr = array('value1','value2','value3','value4','value5','value6');
Using Objective-C , how can I convert the NSString @Panda's Expenses into this string
If I use the following methodology to construct a pandas.DataFrame , I get an
I have a pandas panel of investment pricing data to which I want to
This is my first post here and I wanted to get some input from
This is a self-explanatory question: Why does this thing bubble into my try catch's
I recently came across the pandas library for python, which according to this benchmark
This is my first attempts at creating a data-mart/warehouse and I am a little
This is my code: OleDbConnection connection = new OleDbConnection( Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\\Offline.accdb;Persist Security Info=False); connection.Open();
This is my first time using Magento. I upgraded this site from 1.4.1.1 to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.