Global AI and Data Science

Global AI & Data Science

Train, tune and distribute models with generative AI and machine learning capabilities

 View Only
  • 1.  If Python is slow, why is it so widely used

    Posted Sun May 24, 2020 10:05 AM
    If Python is slow, why is it so widely used for things like science and data analysis? Wouldn't languages like C++ be much faster?

    ------------------------------
    Paul Glenn
    ------------------------------



    #AIandDSSkills
    #DataandAILearning
    #AIandDSSkills


  • 2.  RE: If Python is slow, why is it so widely used

    Posted Mon May 25, 2020 06:30 AM
    Because in science and data analysis development speed is more important that execution speed.

    ------------------------------
    SIGMUND VESTERGAARD
    ------------------------------



  • 3.  RE: If Python is slow, why is it so widely used

    Posted Tue May 26, 2020 09:57 AM
    There are many programming pitfalls in Python that can make for slow execution.
    Loops, for example.  While Pandas is generally good, using the apply() method basically
    means you are using loops. 
     
    Dramatic speedups can be made by manipulating Numpy arrays and exploiting list comprehension.
     
    For instance, I achieved 400x speedup on Pandas code by reformulating the mathematical model,
    translating to Numpy arrays and applying clever stride techniques.
     
    Such speedups often rely on techniques that are discovered using highly skilled Google searches!
     
     


    Alan King
    AI & Blockchain, Finance
    IBM Research






  • 4.  RE: If Python is slow, why is it so widely used

    Posted Tue May 26, 2020 08:29 AM
    Python is very flexible, easy to use when needed to do quantitative and analytical computing. Have massive libraries to help in various data science tasks, easily scalable and code implementation can be done in a shorter time than a language like C++.

    ------------------------------
    Tamás Stefanovits
    ------------------------------