Advantages of writing Python programs?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nuggz
    SBR Sharp
    • 04-28-10
    • 366

    #1
    Advantages of writing Python programs?
    This might be an elementary question for some here, but I have worked with coding in python before and wondered what are the best ways to use it to help with handicapping, aside from the obvious.

    I can see how it would be great to input stats and formulas to generate odds for a game, etc. Is there anything else it is commonly used for, aside from returning scores, risk etc. I guess the question is a bit vague since the actual possibilities of what you could do are endless, but I'm really just wondering where to start.

    Also, does anyone know a good place to find some basic equations that can be helpful? NOT formulas for ranking teams or predicting winners (I plan to try and develop some of those on my own) but just for other helpful calculations. (The tools here are really helpful, but I like to know the math behind it.)

    Thanks.
  • Maverick22
    SBR Wise Guy
    • 04-10-10
    • 807

    #2
    Keep in mind, that my opinion is worth what you are paying me...

    BUT... I'd graduate into something a bit more "advanced" than python...

    Everything however has its place... but if you plan to do some number crunching... I would personally use something else...

    Anyways... Links... :



    RPI: http://en.wikipedia.org/wiki/Ratings_Percentage_Index

    Park Factor(s): http://espn.go.com/mlb/stats/parkfactor

    DIPS: http://en.wikipedia.org/wiki/Defense...ing_statistics

    Last edited by Maverick22; 04-30-10, 10:06 AM.
    Comment
    • Wrecktangle
      SBR MVP
      • 03-01-09
      • 1524

      #3
      Everyone (including me) throws rocks at Python as not being advanced enough. Other than a decent subroutine library and not being compiled (is this correct?) what other problems is there?

      Folks also throw rocks at VBA and Excel but there are some powerful applications written in that environment, and you can build things very quickly with good error trapping.

      I guess my point is, Python may be good enough to do other things given it's capability to scrape and ease of use. I would guess that many new folks would rather not learn two (or more languages) to get down the road. Python may well be good enough.
      Comment
      • Nuggz
        SBR Sharp
        • 04-28-10
        • 366

        #4
        I can understand how down the road some aspects of Python might be over-simplified. As of now while I'm still working on handicapping skills, I think it could be a useful time-saving tool.

        Wrecktangle, you mention Visual Basic (a language I'm also somewhat familiar with), do you think this has more advantages/disadvantages compared to working in Python? At least until I get a better grasp on accurately working with numbers, then I'll probably be back here asking how to 'graduate' from Python.

        Thanks for bestowing your wisdom upon me.
        Comment
        • MadTiger
          SBR MVP
          • 04-19-09
          • 2724

          #5
          I am an ex-computer scientist/software engineer who has never used Python. After reading the thread a few weeks ago, and following up with some info on Python in general, I would say that it has plenty of use for the application in question: sports handicapping. Unless you are a software programmer who wants the extra pain, why ask for it? Solve your problem as simply as possible.

          I have used over two dozen different languages over the years, and each has their place. Some (like C) have more places than others (e.g. LOGO), but they each can solve problems.
          Comment
          • ljump12
            SBR High Roller
            • 12-08-09
            • 113

            #6
            People are always putting down python, but I work at an ib where millions of dollars are put at risk every day, guess what the code is written in? Python. For certain applications python can get the work done much quicker. I'm not saying it can accomplish everything, but when you need to get something out the door fast, a dynamic language like python is just faster than a compiled one.

            You guys are thinking of python as a baby language, it's definitely not. And it's not like your going to "graduate" to a better language... You may however want to learn other languages that can be better suited to other things. For instance speed intensive things, like a Monte-Carlo simulator will run faster in a compiled language like c. No doubt about it. But with the speed of today's computers, there's not too much you need raw speed for.
            Comment
            • MonkeyF0cker
              SBR Posting Legend
              • 06-12-07
              • 12144

              #7
              Originally posted by ljump12
              People are always putting down python, but I work at an ib where millions of dollars are put at risk every day, guess what the code is written in? Python. For certain applications python can get the work done much quicker. I'm not saying it can accomplish everything, but when you need to get something out the door fast, a dynamic language like python is just faster than a compiled one.
              Why would you need to get something out the door fast in handicapping?

              You guys are thinking of python as a baby language, it's definitely not. And it's not like your going to "graduate" to a better language... You may however want to learn other languages that can be better suited to other things. For instance speed intensive things, like a Monte-Carlo simulator will run faster in a compiled language like c. No doubt about it. But with the speed of today's computers, there's not too much you need raw speed for.
              I agree with this.
              Comment
              • MonkeyF0cker
                SBR Posting Legend
                • 06-12-07
                • 12144

                #8
                Originally posted by MadTiger
                I am an ex-computer scientist/software engineer who has never used Python. After reading the thread a few weeks ago, and following up with some info on Python in general, I would say that it has plenty of use for the application in question: sports handicapping. Unless you are a software programmer who wants the extra pain, why ask for it? Solve your problem as simply as possible.

                I have used over two dozen different languages over the years, and each has their place. Some (like C) have more places than others (e.g. LOGO), but they each can solve problems.
                One would really need to know each language to know which presents the easiest methods for performing certain tasks. So that is a bit of a moot point. Also, what may be easiest to program now might make a headache for you later.
                Comment
                • Maverick22
                  SBR Wise Guy
                  • 04-10-10
                  • 807

                  #9
                  *** Full Disclosure: Python is "OK" in my book, I use it for *certain* parts of my application architecture... Mainly for ETL tasks from my database to my "simulator". ***

                  The Benefits & Advantages: It's easy to use, forces good code formatting habits(as a former Teacher's Assistant, I can appreciate this), a loose concept of data types (not sure if this is good/bad), easy database connectivity in unix, no need compilations and computer architecture dependent executables and the list goes on...

                  However, just because millions of dollars worth of calculations are done on python, doesn't necessarily speak to its usefulness or how "good" is it. You could write the same set of programs in Assembly...or even machine code IF you wanted to, by why would you?

                  For my simulations, i never for a second considered python, because it is slow (http://shootout.alioth.debian.org/u3...chameneosredux)

                  When I knew i was designing and building a tool to perform 10-20k simulations in a few seconds... and for a few hours... why would I opt for the slower language, and draw out execution time even longer.

                  But for what he is attempting to do... Which could only be a handful of things... Speed is fairly important... Ease of use only so much...(at least to me).

                  The languages are close enough (in construction) to not entirely matter...

                  I encourage the OP to use whatever his is comfortable with, and I am not so much bashing as... noting personal experiences.

                  Note: (Schools dont generally teach Python either... has to be for a good reason)
                  Comment
                  • acarmelo1
                    SBR Hall of Famer
                    • 09-29-09
                    • 6321

                    #10
                    I prefer visual basic or c++
                    Comment
                    • ljump12
                      SBR High Roller
                      • 12-08-09
                      • 113

                      #11
                      Note: (Schools dont generally teach Python either... has to be for a good reason)
                      fwiw my college did, maybe that's why I'm so biased. I just think it's a softer language to be introduced to. It's more forgiving, and doesn't scare people away.
                      Comment
                      • Nuggz
                        SBR Sharp
                        • 04-28-10
                        • 366

                        #12
                        Originally posted by Maverick22

                        Note: (Schools dont generally teach Python either... has to be for a good reason)
                        Python was the first thing I learned in my CS class. Doesn't seem too uncommon?

                        Out of curiosity, how complex are the tools you more experienced handicappers have developed/built? (in terms of both math and coding) Just trying to find a good jumping off point.
                        Comment
                        • xyz
                          SBR Wise Guy
                          • 02-14-08
                          • 521

                          #13
                          The lack of static typing in Python makes it hard for me to read code written by other people.
                          Comment
                          • sycoogtit
                            SBR Sharp
                            • 02-11-10
                            • 322

                            #14
                            Originally posted by Maverick22
                            Note: (Schools dont generally teach Python either... has to be for a good reason)
                            MIT starts you off in lisp. Does that mean we should all learn that?
                            Comment
                            • Maverick22
                              SBR Wise Guy
                              • 04-10-10
                              • 807

                              #15
                              Last edited by Maverick22; 05-01-10, 03:59 PM.
                              Comment
                              • arwar
                                SBR High Roller
                                • 07-09-09
                                • 208

                                #16
                                Originally posted by ljump12
                                People are always putting down python, but I work at an ib where millions of dollars are put at risk every day, guess what the code is written in? Python. For certain applications python can get the work done much quicker. I'm not saying it can accomplish everything, but when you need to get something out the door fast, a dynamic language like python is just faster than a compiled one.

                                You guys are thinking of python as a baby language, it's definitely not. And it's not like your going to "graduate" to a better language... You may however want to learn other languages that can be better suited to other things. For instance speed intensive things, like a Monte-Carlo simulator will run faster in a compiled language like c. No doubt about it. But with the speed of today's computers, there's not too much you need raw speed for.
                                since when is an interpretor faster than binary?
                                Comment
                                • arwar
                                  SBR High Roller
                                  • 07-09-09
                                  • 208

                                  #17
                                  Originally posted by sycoogtit
                                  MIT starts you off in lisp. Does that mean we should all learn that?
                                  hey now don't knock LISP
                                  Comment
                                  • MadTiger
                                    SBR MVP
                                    • 04-19-09
                                    • 2724

                                    #18
                                    Originally posted by Maverick22
                                    It's to that point, about now. No converts being made any time soon.
                                    Comment
                                    • Trucker George
                                      SBR High Roller
                                      • 01-09-10
                                      • 194

                                      #19
                                      There are many, many archived discussions (arguments) and articles about the interpreted vs. compiled languages, static vs. dynamically typed languages, etc. all around the Internet. Try googling the topic to find more opinions than you will ever have time to read. I've been reading the advantages and disadvantages of various programming paradigms for years and there is no definitive answer to the question "which is always better". The closest we can get to answering the "which is better" question seems to be: which is the better tool for your particular problem.

                                      For our purposes, the "particular problem" aspect can be narrowed down to sportsbetting research and modeling.

                                      On the other hand, the "which is the better tool" aspect is not so easily defined. It's not so easily defined because we each have varied skills (from zero experience to guru) for any particular language. At this point the choice of which is the better language becomes more of an individual preference: the better tool for me may not be the better tool for you, but often both tools will allow us to achieve the same computational result.

                                      Regarding Python the language: I personally really like Python for sportsbetting. Python definitely is a full-featured, mature, powerful general-purpose language with large libraries, "batteries included" in the core language (such as Sqlite, XML parsing, http libraries, etc.), and a large community; it is also easy to learn compared to lower level languages. For many sporstbetting research tasks it is just great.

                                      Some posters have mentioned that for their particular needs (e.g., running models for 100+ college hoops games) Python is not fast enough. Yes, it is true Python is slower than compiled languages and this may be a problem for running computationally intensive applications. However, in the Python world there are ways to optimize your code to increase speed (such as by using the psyco module). Another way to increase Python's speed is to use Cython, in which you write your code in Python and it is then converted to equivalent C code, which you then compile and is as fast as just about anything out there. It should be noted that the "speed problem" will only come into effect for heavy duty number crunching and many aspects of sportsbetting research (such as web scraping or developing your ideas when interacting with a database) do not require such speed; many times network latency or you sitting at your keyboard thinking about how to develop your ideas will be the bottleneck.

                                      Personally, I use Python because I have the most experience with it compared to other languages I've used, such as Java. For me, there's nothing I can do in Java that I can't do in Python. This is not to say that Python is "better" than Java, but that for me, right now and as of this moment in time, I can get a program written in my preferred language much quicker than my less well known languages. Others' experiences will of course be different, and perhaps in respect to Python and Java, the exact opposite. (Though I will say that if I were to factor "me" and and "my personal experience and skills" out of the equation, then at least in case of Python vs. Java, objectively speaking, it is fair to say that Python programs generally require less code to write and development time for most programs will be quicker.)

                                      And before I go into the never-ending quagmire, tar-baby, and pissing contest of "which language is best" debate (which I don't want to do): I would like to suggest Clojure as a language to consider using. These days I prefer to use Clojure to solve sportsbetting-related problems. I like the functional paradigm and ease-of-concurrency that this language offers. It's worth having a look!
                                      Comment
                                      • MonkeyF0cker
                                        SBR Posting Legend
                                        • 06-12-07
                                        • 12144

                                        #20
                                        Solid post.
                                        Comment
                                        • rockchalk24
                                          SBR Hustler
                                          • 01-21-10
                                          • 52

                                          #21
                                          Originally posted by Maverick22

                                          Note: (Schools dont generally teach Python either... has to be for a good reason)
                                          Are you sure about this? Just checked MIT opencourseware, and they teach python in Introduction to Computer Science and Programming.

                                          Comment
                                          • Flight
                                            Restricted User
                                            • 01-28-09
                                            • 1979

                                            #22
                                            Python's a great language with many possible applications. If you're a beginner, I would definitely start there because it's easy to learn.

                                            The best statement here is to chose the tool that best fits your job. What specific problem are you trying to solve, or what tool are you trying to come up with?
                                            Comment
                                            • RockyS
                                              Restricted User
                                              • 03-23-10
                                              • 1091

                                              #23
                                              You are looking from the wrong side of programming.

                                              You can't compare C++/C# with VB or python, because they are made for their own reasons. And yes, python is old programming language in Europe's colleges they don't use it anymore, we are on C++/C# and .NET.
                                              Let's take betting tools for example, why the hell would you write your program in C++/C# if it won't be heavy duty program? And why if you are good at any other language.
                                              For this kind of program also xhtml/php/javascript are good option if you know how to use it.
                                              Betting program in python has 3000 lines of code, the same program in C++/C# has "only" 2400 lines, 600 lines of code isn't that much in this kind of "simple" application. And both applications do what they are supposed to.
                                              But using "modern" programming language means that you can expand your application much more wider than with python with less troubles and a lot less lines.

                                              And if you think that using VB is easier to make fancy application than in C++/C# then you are wrong, all VS are offering drag and drop menus all you have to do is write functions for that objects, it's the same thing everywhere, vb,c#,cpp...


                                              USE WHAT YOU KNOW AND DO WHAT YOU ARE BEST AT!
                                              Comment
                                              SBR Contests
                                              Collapse
                                              Top-Rated US Sportsbooks
                                              Collapse
                                              Working...