QBoard » Artificial Intelligence & ML » AI and ML - Conceptual » Why is Python such a popular language in the AI field?

Why is Python such a popular language in the AI field?

  • First of all, I'm a beginner studying AI and this is not an opinion-oriented question or one to compare programming languages. I'm not implying that Python is the best language. But the fact is that most of the famous AI frameworks have primary support for Python. They can even be multi language supported, for example, TensorFlow that supports Python, C++, or CNTK from Microsoft that support C# and C++, but the most used is Python (I mean more documentation, examples, bigger community, support, etc). Even if you choose C# (developed by Microsoft and my primary programming language) you must have the Python environment set up.
    I read in other forums that Python is preferred for AI because the code is simplified and cleaner, good for fast prototyping.
    So what is the big deal with Python?
    Why is there a growing association between Python and AI?
     
    This post was edited by Bushan Kumar at December 5, 2020 1:01 PM IST
      December 5, 2020 1:00 PM IST
    0
  • Python comes with a huge amount of inbuilt libraries. Many of the libraries are for Artificial Intelligence and Machine Learning. Some of the libraries are Tensorflow (which is high-level neural network library), scikit-learn (for data mining, data analysis and machine learning), pylearn2 (more flexible than scikit-learn), etc. The list keeps going and never ends.

    You can find some libraries here.

    Python has an easy implementation for OpenCV. What makes Python favourite for everyone is its powerful and easy implementation.
    For other languages, students and researchers need to get to know the language before getting into ML or AI with that language. This is not the case with python. Even a programmer with very basic knowledge can easily handle python. Apart from that, the time someone spends on writing and debugging code in python is way less when compared to C, C++ or Java. This is exactly what the students of AI and ML want. They don't want to spend time on debugging the code for syntax errors, they want to spend more time on their algorithms and heuristics related to AI and ML.
    Not just the libraries but their tutorials, handling of interfaces are easily available online. People build their own libraries and upload them on GitHub or elsewhere to be used by others.
    All these features make Python suitable for them.
      December 5, 2020 1:03 PM IST
    0
  • Practically all of the most popular and widely used deep-learning frameworks are implemented in Python on the surface and C/C++ under the hood.

    I think the main reason is that Python is widely used in scientific and research communities, because it's easy to experiment with new ideas and code prototypes quickly in a language with minimal syntax like Python.

    Moreover there may be another reason. As I can see, most of the over-hyped online courses on AI are pushing Python because it is easy for newbie programmers. AI is the new marketing hot word to sell programming courses. ( Mentioning AI can sell programming courses to kids who want to build HAL 3000, but can not even write a Hello World or drop a trend-line onto an Excel graph. :)

      December 5, 2020 1:04 PM IST
    0
  • What attracts me to Python for my analysis work is the "full-stack" of tools that are available by virtue of being designed as a general purpose language vs. R as a domain specific language. The actual data analysis is only part of the story, and Python has rich tools and a clean full-featured language to get from the beginning to the end in a single language (use of C/Fortran wrappers notwithstanding).

    On the front end, my work commonly starts with getting data from a variety of sources, including databases, files in various formats, or web scraping. Python support for this is good and most database or common data formats have a solid, well-maintained library available for the interface. R seems to share a general richness for data I/O, though for FITS the R package appears not to be under active development (no release of FITSio in 2.5 years?). A lot of the next stage of work typically occurs in the stage of organizing the data and doing pipeline-based processing with a lot of system-level interactions.

    On the back end, you need to be able present large data sets in a tangible way, and for me, this commonly means generating web pages. For two projects I wrote significant Django web apps for inspecting the results of large Chandra survey projects. This included a lot of scraping (multiwavelength catalogs) and so forth. These were just used internally for navigating the data set and helping in source catalog generation, but they were invaluable in the overall project.

    Moving to the astronomy-specific functionality for analysis, it seems clear that the community is solidly behind Python. This is seen in the depth of available packages and level of development activity, both at an individual and institutional level (http://www.astropython.org/resources). Given this level of infrastructure that is available and in work, I think it makes sense to direct effort to port the most useful R statistical tools for astronomy to Python. This would complement the current capability to call R functions from Python via rpy2.If you are interested, I strongly recommend that you read this article, here it is a question of comparing programming languages https://diceus.com/what-technology-is-b ... nd-java-r/ I hope it helps.Good Luck
    This post was edited by Samar Patil at December 5, 2020 1:07 PM IST
      December 5, 2020 1:05 PM IST
    0
  • It's a mix of many factors that together make it a very good option to develop cognitive systems.
    1. Quick development
    2. Rapid prototyping
    3. Friendly syntax with almost human-level readability
    4. Diverse standard library and multi-paradigm
    5. It can be used as a frontend for performant backends written in compiled languages such as C/C++.
    Existing performant numerical libraries, such as numpy and others already do the intensive bulk work for you which lets you focus more on architectural aspects of your system.
    Besides, there is a very big community and ecosystem around Python, which results in a diverse set of available tools oriented to diffent kind of tasks.
    This post was edited by Nitara Bobal at December 5, 2020 1:09 PM IST
      December 5, 2020 1:09 PM IST
    0
  • Python has a standard library in development, and a few for AI. It has an intuitive syntax, basic control flow, and data structures. It also supports interpretive run-time, without standard compiler languages. This makes Python especially useful for prototyping algorithms for AI.
      December 12, 2020 5:21 PM IST
    0
  • Many people who are interested in machine learning aren't professional programmers. For example there are mathematicians who work on differential equations and there are physicists who work on stochastic processes. These people aren't programmers. So using a language like C++ which is hard to learn is only detrimental to their works. And also creating a model in Python is much easier compared with C++ and Java. You have to use C++ when you want to create a game engine because the graphics is directly related to the hardware and if you want to be a professional Android programmer you have to learn Java. What are the benefits of choosing C++ and Java over Python when your work mainly consists of linear algebra and statistics?
      December 29, 2020 3:18 PM IST
    0