Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How do I write a line of code into an excel spreadsheet using Python code?
My python code writing experience is scarcely a month and and I am now the proud parent of what has become a 500 line program written in python that process daily data so I can monitor my blood sugar. Results are presently written to a text file and it looks very 1980’s-ish. I want to create charts/graphs showing my trends and figure that Excel is a good way to do it.

I can now write the results to an excel file but only if I generate the entire output from all the data in the text file every time a new line of data is generated.

It would be far more efficient if I could append the daily line of data to the existing spreadsheet instead of rewriting it. As I see it, I would have to detect the last line written and go to the next row to place the new row of data.

Thoughts appreciated….
it depends on what package you use, but all of them have respective methods to write to specific cell/range
Python Excel The Definitive Guide
So there are serval ways,i like best Pandas in Jupyter notebook.
Dataframe look similar to Excel and can export to Excel,or drop Excel and do all in tool over
Common Excel Tasks Demonstrated in Pandas
Quote: I want to create charts/graphs showing my trends and figure that Excel is a good way to do it.
This is also something that tool i mention has very good support better than Excel.
Example Vis1, Vis2.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How do I translate this into python code? (excel vlookup) eeps24 6 171 Yesterday, 05:54 PM
Last Post: eeps24
  Python equivalent of Matlab code kwokmaster 5 389 Apr-03-2020, 12:02 AM
Last Post: scidam
  Read exel with merged cells and write to another excel SriMekala 0 833 Aug-10-2019, 07:14 AM
Last Post: SriMekala
  how read and write merged cells in excel SriMekala 1 3,301 Aug-07-2019, 11:27 PM
Last Post: scidam
  Python Package for deploying python code in Excel on machines without python UGuntupalli 2 3,964 Jul-31-2019, 04:05 AM
Last Post: UGuntupalli
  Python write result of VAR to excel file wissam1974 8 1,589 Jul-13-2019, 01:09 PM
Last Post: wissam1974
  python code for Bartlett confidential band wissam1974 2 729 Feb-16-2019, 02:25 PM
Last Post: wissam1974
  Newbie at using python and tensorflow getting error when running simple code FeatherineAu 0 2,022 Sep-28-2018, 02:09 PM
Last Post: FeatherineAu
  Help with Python technologies and structure code giu88 13 1,945 Aug-11-2018, 10:15 PM
Last Post: ichabod801
  Pandas - Write to Exisitng Excel File - Sorted List dj99 4 4,397 Jul-29-2018, 07:56 AM
Last Post: dj99

Forum Jump:

Users browsing this thread: 1 Guest(s)