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
 Duplicate specific 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
Fabi K Posted - 04/29/2022 : 04:32:30 AM
Hi everyone,

I want to duplicate an existig sheet with data to a new sheet with another template. I dont want to duplicate all data but only specific columns selected by theier longnames. What is the best way to do this?
I tried using pandas but than the data was only in one column.

Thanks in advance
Fabi
2   L A T E S T    R E P L I E S    (Newest First)
Fabi K Posted - 05/09/2022 : 06:04:20 AM
Hi James,

thanks for your help. I’ve solved it a little differently. The problem was that the csv data is very large and wks.to_list() did not work. So I used wb.duplicate() (def originpro.base.BasePage.duplicate) and deleted the unnecessary columns with wb.del_col(). After that, the data was small enough to use wb.to_df() and put it in a template where I could process the data further.
YimingChen Posted - 05/02/2022 : 11:57:53 AM
You can use wks.to_list() to pass data from specified column to Python list and wks.from_list() to pass data back to worksheet column. See the reference page:
https://www.originlab.com/python/doc/originpro/classoriginpro_1_1worksheet_1_1_w_sheet.html#a1373d42387a3ac2396a0e535fee74078

James

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