Python Forum
Thoughts on how to approach a project
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thoughts on how to approach a project
#1
I am a moderately experienced VBA coder, and have only begun learning Python (second post on this forum) because I would like to take on a new project which takes an Excel program/spreadsheet and duplicates what it does using Python.

As you probably know, Excel is made up of rows and columns, and works/calculates left to right within a row, then moves down a row, and starts over, etc..  In addition, a value that is calculated in cell A1, for example, is typically used in cell A2, and so on down the row.

In my spreadsheet, assume I have 80 rows and 200 columns.  Formulas (nothing fancy, just normal math) are copied downward in each column to all 80 rows.  In other words, every formula in a particular column is the same thing (of course, the values used in those formulas are different).

My general questions:

1.  Does Python even lend itself to calculating/behaving like Excel?  If not, is there a better language?

2.  If so, how should I think of duplicating a spreadsheet-like program in Python?  Should I think of a row as a list? dictionary? etc? Is that hard to do with a big list?  Maybe a make a bunch of smaller lists to duplicate a section of the spreadsheet?  etc, etc.

I just need some general thoughts on whether to try, and if so, maybe how to approach it from a big picture standpoint?

thanks for looking
Reply
#2
(Dec-21-2016, 11:09 PM)birdieman Wrote: I would like to take on a new project which takes an Excel program/spreadsheet and duplicates what it does using Python
Is your goal just to duplicate a spreadsheet program in any language, or do you have a different goal? (1) implies that it would be any language (as opposed to some people who might simply propose this as a project on which to learn Python). For (2) it really depends on your requirements. Do you want to make a full spreadsheet program? (You should enumerate the features.) Or a subset? What's the subset?

One thing is that existing spreadsheet programs are designed such that idiots should be able to use them, and so efficiency may have been sacrificed. If you don't intend to support idiots using your program, then you can optimize some things. But again, this comes back to clarifying requirements.
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Reply
#3
You should also take a look at what's already been done with python.
Here's a link to the available excel interface programs https://pypi.python.org/pypi?%3Aaction=s...mit=search
Reply
#4
The Excel program is a financial-type program, and if duplicated in another language, would eliminate the need for anyone I send it to to have Excel on their PC (I realize Excel is common, but I wanted to eliminate the need to have it installed)

Regarding Python, I had heard/read that it is a good language, and is common in programming circles -- I simply do not know enough about it to determine if it would be a language that lends itself to doing (like the flow of Excel) what I want to do.  I am not a programmer by profession.

More details:  In Excel, I use a Userform to take user input, and the spreadsheet does all the calculations with that input.  In Python, I had thought that I would use PY QT as my GUI (which, from my limited knowledge of it and initial playing around with it, is very similar to Userforms, which would make the learning of Py Qt easier/quicker).

Before I put in hundreds of hours learning Python, I thought I would ask experts such as yourself if I should continue learning, or would xxx language better suit me.  I also realize that probably any language can do what I want, but some are probably suited better than others.

No, I do not want to make a spreadsheet program in Python, but rather was thinking that when I began programming, I would use Excel's FLOW logic (because I know it well) to program the logic of my Excel program in Python -- and, with my limited knowledge of Python, was just wondering how to mentally translate/think about the row/column logic of Excel into Python (and the programming flow).

Thanks for responding -- sorry if I was vague
Reply
#5
Quote:Before I put in hundreds of hours learning Python, I thought I would ask experts such as yourself if I should continue learning, or would xxx language better suit me.

If you know of another language that doesn't have a learning curve, fill me in. I have been programming for just under 50 years and I haven't found one yet.
Have you discovered the Vulcan mind meld?

That said, the learning curve for Python is much smaller than for languages like 'C'.
Python I am sure can quite adequately perform your task.

Perhaps a better method would be to look at what has been done with Python.

There is also a built in graphics package that comes with Python named tkinter.

Though Qt offers a lot more, it does require another package (not a big deal though).
Reply
#6
Pandas is the best way to deal with Excel in Python.
If also use Pandas it with Jupyter notebook you get a dataframe that look like Excel.
Examples link_1, link_2, link_3
Reply
#7
Thanks to all of you for your responses -- will continue my learning and check out the suggestions
Reply
#8
(Dec-22-2016, 12:32 AM)snippsat Wrote: Pandas is the best way to deal with Excel in Python.
If also use Pandas it with Jupyter notebook you get a dataframe that look like Excel.
Examples link_1, link_2, link_3

I also suggest you to learn Python along with Pandas. Perhaps Mathplotlib too.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#9
Python is really great language in fintech software development. Read about main advantages here
Reply
#10
Check PyQt license terms for commercial use.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What is the best approach to training a final model after cross validation? amjass12 0 457 Jul-21-2021, 10:15 AM
Last Post: amjass12
  extract tabe from nested dictionary, find generic approach,clever way tonycat 4 1,300 Aug-31-2020, 09:22 AM
Last Post: tonycat
  Alternative approach to iterate numerous linear regressions with xlsx data? john_538 0 1,584 Apr-07-2018, 10:15 PM
Last Post: john_538

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020