User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 391,944 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,891 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 259 | Replies: 3
Reply
Join Date: May 2008
Posts: 3
Reputation: Tyrfing is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Tyrfing Tyrfing is offline Offline
Newbie Poster

Writing arrays to a column of a spreadsheet?

  #1  
May 20th, 2008
Hello, I have a program that generates several 1-dimensional arrays that I would like to conduct data analysis on.

I was wondering if there was some sort of python tool (or module, or anything) that could write these arrays to a column of a spreadsheet ( in OpenOffice formatting).

Is there a way to do this, or would my best bet be to write the arrays to a text file, hope the formatting is okay, and copy paste that into OpenOffice.


Any ideas?

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Posts: 384
Reputation: woooee is on a distinguished road 
Rep Power: 2
Solved Threads: 52
woooee woooee is offline Offline
Posting Whiz

Re: Writing arrays to a column of a spreadsheet?

  #2  
May 20th, 2008
OpenOffice will import comma delimited text files, or any other delimiter that you care to choose. If there are commas in the data then use something like comma+space+space as the delimiter. Here is a dated link for creating the spreadsheet in python. It refers to StarOffice (or something like that), which is a former incarnation of OpenOffice, so hopefully this still works. http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Searching the oooforum will probably yield more hits. Hope this gets you started.
Reply With Quote  
Join Date: Jul 2004
Posts: 2
Reputation: innersmile is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
innersmile innersmile is offline Offline
Newbie Poster

Re: Writing arrays to a column of a spreadsheet?

  #3  
May 20th, 2008
You can try scipy/numpy or pylab (in matplotlib)

numpy.savetxt()
http://www.scipy.org/Numpy_Example_L...24fbd305b79f34

pylab.save()
http://matplotlib.sourceforge.net/pylab_commands.html
Reply With Quote  
Join Date: May 2008
Location: Toronto
Posts: 37
Reputation: kdoiron is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
kdoiron's Avatar
kdoiron kdoiron is offline Offline
Light Poster

Re: Writing arrays to a column of a spreadsheet?

  #4  
May 22nd, 2008
If your array is a list, just create a string for each array using "tab.join(array)", then write the string to a sequential file. Use Excel (or whatever the open-office equivalent is) and import it as a tab-delimited text file.
But I don't like SPAM!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Python Marketplace
Thread Tools Display Modes

Other Threads in the Python Forum

All times are GMT -4. The time now is 8:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC