Forums

Getting Started - 1st Lines of Code

  1. I watched this ytube vid https://www.youtube.com/watch?v=rkx5_MRAV3A.
  2. I read the book recommended at approximately the 1:53:00 point in the ytube vid, Think Python (2nd edition updated for Python 3) by Allen B. Downey.
  3. I've worked the exercises in the book that seem to be the most applicable to what I am trying to do.
  4. But I don't know what my first key strokes need to be.
  5. I am simply trying to take certain numerical data in various Excel files (i.e. pharma data) and compute comparisons/differences/changes from one point in time to another.
  6. I have executed a proof of concept in Excel and demonstrated, also in Excel, the ability to scale the process.
  7. However, scaling in Excel is extremely tedious, hence I am trying to execute the scaling in Python.
  8. QUESTION: How do I write my 1st lines of code to access data in Excel files by patient, by date and by field in order to compute comparisons/differences/changes from one point in time to another?
  9. Thank you for your time and expertise.

Hi there,

I haven't worked with excel-via-python in years, but the good news is that it was definitely possible back then, and I imagine it's only got easier.

A quick google search's first two results look very promising:

Hopefully between those two you should find some pointers to get you started! Let us know how you get on....

Thank you Harry. I am reviewing your suggestions. At first pass, it appears the chapter 12 documentation seems to be instructing how to perform work in Excel using Python. The second link also appears it may be about manipulating Excel files using Python.

I'm sorry I was not clear. If I have a strength, it isn't expressing myself in words.

I want to replace Excel with Python. I've proven certain things in/using Excel but I want Python to take over from here forward. While I have executed my proof of concept and demonstrated scale capabilities in Excel, I want to recreate in Python what I have done in Excel. I want Python to be the work horse where all the current and future input data, computations, and output occur.

Thank you for your time and expertise! I appreciate if it very much!

Sorry, I think I misunderstood -- your lines 5 and 8 seems to be saying you wanted to extract data from an excel spreadsheet.

If you want something to replace excel, sciencey types are using Ipython notebooks and numpy+pandas. Or, in web development, we would just use a database... You could look around for tutorials on those two (although to use ipython notebooks on pythonanywhere you'd have to upgrade to a paid account).

But your question does sound quite open-ended. Do you think you might get some mileage out of our partners at codementor?

No need for apology!! I'm not very good at expressing thoughts in words.

Yes, you are correct. In order for me to replicate in Python what I have executed on Excel, my immediate desire is to read/obtain/use the existing data currently in Excel. If I can replicate in Python what I have done in Excel I feel that would increase my confidence that I am correctly programming in Python.

However, due to the size of the files, quantity of files, and speed, the ultimate goal is to have Python completely replace Excel. So I would envision that eventually Python would contain my data files, my coding, and the resulting output(s).

I'll look into the codementor.

Thank you for all your help!! I greatly appreciate it!!