The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Python
 move the data

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ulhong84 Posted - 08/01/2022 : 8:33:08 PM
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:OriginPro 2002 (9.9.0220)


I have several data set in one column.
I want to rearrange each data in each column as shown below.

A(x)
measurement1
3
6
5
measurement 2
5
8
9
measurement 3
5
6
7

A(x) B(Y) C(Y)
measurement1 measurement 2 measurement 3
3 5 5
6 8 6
5 9 7


How can I make it in python code builder?


1   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 08/02/2022 : 08:34:21 AM
Can you try the script below?

import originpro as op
wks = op.find_sheet()
data = wks.to_list(0)
chunk_size = 4
chunked_list = [data[i:i+chunk_size] for i in range(0, len(data), chunk_size)]
wks = op.new_sheet()
wks.from_list2(chunked_list, 0, 0)


James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000