Answers.Body: <p>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).</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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 (<a href="http://www.astropython.org/resources" rel="noreferrer">http://www.astropython.org/resources</a>). 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 <a href="https://diceus.com/what-technology-is-b" rel="noreferrer">https://diceus.com/what-technology-is-b</a> ... nd-java-r/ I hope it helps.Good Luck</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-03T03:26:04.043Z
Answers.Text: Thanks for sharing. I would love if we have the summary on top and then full detail as yours after that.
Answers.UserDisplayName: Nam G VU
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-23T09:25:07.680Z
Answers.LastActivityDate: 2018-05-23T09:25:07.680Z
Answers.UserDisplayName: William Nickson
Answers.Body: <p>It's a mix of many factors that together make it a very good option to develop cognitive systems.</p>
  
  <ul>
  <li>Quick development</li>
  <li>Rapid prototyping</li>
  <li>Friendly syntax with almost human-level readability</li>
  <li>Diverse standard library and multi-paradigm</li>
  <li>It can be used as a frontend for performant backends written in compiled languages such as C/C++.</li>
  </ul>
  
  <p>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. </p>
  
  <p>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. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-01T12:04:56.220Z
Answers.LastActivityDate: 2019-02-01T12:04:56.220Z
Answers.UserDisplayName: AlexPnt
Answers.Body: <p>That’s because python is a modern scripting object-oriented programming language that has stylish syntax. Contrary to structural programming languages like java and C++, its scripting nature enables the programmer to test his/her hypothesis very fast. Furthermore, there are lots of open source machine learning libraries (including scikit-learn and Keras) that broaden the use of python in AI field.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-24T19:39:16.993Z
Answers.LastActivityDate: 2018-05-24T19:39:16.993Z
Answers.UserDisplayName: pythinker
Answers.Body: <p>Python has rich library, it is also object oriented, easy to program. It can be also used as frontend language. That's why it is used in artificial intelligence. Rather than AI it is also used in machine learning, soft computing, NLP programming and also used as web scripting or in Ethical hacking. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-02T11:27:54.953Z
Answers.LastActivityDate: 2019-02-28T23:18:36.397Z
Answers.LastEditDate: 2019-02-28T23:18:36.397Z
Answers.UserDisplayName: Rocx En Ruff
Answers.Body: <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-15T15:40:18.420Z
Answers.Text: Nice point about the interpretive capability of Python.  It seems like flexibility and development speed is strongly favored over the greater "horsepower" of compiled languages.
Answers.UserDisplayName: DukeZhou
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-15T12:04:53.177Z
Answers.LastActivityDate: 2017-06-15T12:04:53.177Z
Answers.UserDisplayName: Epsilekt
Answers.Body: <p>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?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-03T03:40:07.950Z
Answers.Text: You make clear sense! That's what Google see and invest into library in python to provide to those non-pro coding scientist
Answers.UserDisplayName: Nam G VU
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-05T08:04:58.973Z
Answers.LastActivityDate: 2020-05-05T08:04:58.973Z
Answers.UserDisplayName: bitWise
Answers.Body: <p>I actually prefer C for machine learning. Because like in life, in the world as we know it, consists of never-ending "logic gates" (which basically is like flipping a coin - there WILL be 2 possible outcomes - not counting the third: landing on the side!). Which also means that while the universe seems never-ending, we still never stop finding those things that are even smaller than the last smallest thing, right?</p>
  
  <p>So... To put it in a context when programming C, I can control the memory usage more efficiently by coding smaller snippets that get combined, to always form smaller &amp; efficient "code-fragments", that make up what we would call "cells" in biology (it got a measurable function, and has some pre-set properties).</p>
  
  <p>Thus, I like to optimize for low RAM usage, low CPU usage etc. when programming AI. I have only done feedforward with a basic genetic algorithm in C, but the more advanced recurrent neural network I wrote in C++ (ONLY because of the simplicity of using <code>std::vector&lt;TYPE&gt; name;</code>, so I wrote my own <code>cvector.c</code>: <a href="https://pastebin.com/sBbxmu9T" rel="nofollow noreferrer">https://pastebin.com/sBbxmu9T</a>  &amp; <code>cvector.h</code>: <a href="https://pastebin.com/Rd8B7mK4" rel="nofollow noreferrer">https://pastebin.com/Rd8B7mK4</a> &amp; debug: <a href="https://pastebin.com/kcGD8Fzf" rel="nofollow noreferrer">https://pastebin.com/kcGD8Fzf</a> - compile with <code>gcc -o debug debug.c cvector.c</code>). That actually helped a lot in the quest of optimizing CPU usage (and overall runtime) when creating optimized neural networks.</p>
  
  <p><strong>EDIT:</strong>
  So I am in one sense really see the opposite of what AlexPnt sees, when it comes to exploring what is possible within the realm of a "self".</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-01T03:14:48.847Z
Answers.LastActivityDate: 2020-04-14T22:09:29.960Z
Answers.LastEditDate: 2020-04-14T22:09:29.960Z
Answers.UserDisplayName: anonusr
Answers.Body: <p>We also work with Python in <a href="https://www.n-ix.com/python-development/" rel="nofollow noreferrer">our company</a>. One of the sphere that we use it for is fast prototyping and building highly scalable web applications. For over two decades, our Python developers have been providing businesses with full-stack web-development services, client-server programming and administration. We help our clients build high-load web portals, automation plugins, high-performance data-driven enterprise systems, and many more.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-24T11:38:00.757Z
Answers.LastActivityDate: 2020-01-24T11:38:00.757Z
Answers.UserDisplayName: Yuliia
Answers.Body: <p>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 a 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 <a href="https://wiki.python.org/moin/PythonForArtificialIntelligence" rel="noreferrer">here</a>.</p>
  <p>Python has an easy implementation for OpenCV. What makes Python favorite for everyone is its powerful and easy implementation.</p>
  <p>For other languages, students and researchers need to get to know the language before getting into ML or AI with that language. <em>This is not the case with Python</em>. 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. <em>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</em></p>
  <p><em>Not just the libraries but their tutorials, handling of interfaces are easily available online</em>. People build their own libraries and upload them on GitHub or elsewhere to be used by others.</p>
  <p>All these features make Python suitable for them.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-11T15:17:10.380Z
Answers.Text: Endless trade offs in all these areas: what python has in simplicity/built in libraries it can lose in stuff like speed, memory usage etc. Somewhat like vehicles - a simple automatic car is easy to learn to drive with and get around a city but won't get you very far in a race vs a race car, plane or an aircraft carrier. Can only try and pick the best tool for the problem.
Answers.UserDisplayName: Philip
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-29T14:20:20.583Z
Answers.Text: Python is without doubt a rapid language to prototype code in, but it may be said that i is a slow language to deliver in. It lacks support for programming in the large, but most 'AI' programming is akin to saying you are doing operating system development by writing a Windows GUI. Look at the documentation for setting up the file structure for a full project https://docs.python-guide.org/writing/structure/. It doesn't support multicore CPUs as it lacks modern multithreading. So you buy an expensive 8 core PC, use 1 core with code that runs 10 times slower than the same in a compiled language.
Answers.UserDisplayName: Nick
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-07T19:19:41.127Z
Answers.Text: "They don't want to spend time on debugging the code for syntax errors" - Does any programmer want to do this? Is Python the best languge for everything? I am not convinced.
Answers.UserDisplayName: Frank Puffer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-06-16T05:56:16.907Z
Answers.LastActivityDate: 2021-01-29T02:31:38.807Z
Answers.LastEditDate: 2021-01-29T02:31:38.807Z
Answers.UserDisplayName: Ugnes
Body: <p>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 multilanguage supported, for example, TensorFlow that supports Python, C++, or CNTK from Microsoft that supports 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.</p>
  <p>I read in other forums that Python is preferred for AI because the code is simplified and cleaner, good for fast prototyping.</p>
  <p>I was watching a movie with AI thematics (Ex Machina). In some scenes, the main character hacks the interface of the house automation. Guess which language was on the scene? Python.</p>
  <p>So, what is the big deal with Python? Why is there a growing association between Python and AI?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-23T10:33:45.800Z
Comments.Text: Just bear in mind that the representation of programming languages in movies is not usually related to real life! Anything that looks like cryptic gobbledegook to lay people is usually fine...
Comments.UserDisplayName: Oliver Mason
Tags: <machine-learning><tensorflow><python><programming-languages>
Title: Why is Python such a popular language in the AI field?
UserDisplayName: Douglas Ferreira
ThreadText: # Why is Python such a popular language in the AI field?
  
  (Asked by: username_0 on 2017-06-15)
  
  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 multilanguage supported, for example, TensorFlow that supports Python, C++, or CNTK from Microsoft that supports 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.
  
  I was watching a movie with AI thematics (Ex Machina). In some scenes, the main character hacks the interface of the house automation. Guess which language was on the scene? Python.
  
  So, what is the big deal with Python? Why is there a growing association between Python and AI?
  
  **Tags:** machine-learning, tensorflow, python, programming-languages
  > **Comments:**
  > **username_1**: Just bear in mind that the representation of programming languages in movies is not usually related to real life! Anything that looks like cryptic gobbledegook to lay people is usually fine...  
  
  ---
  
  ## 9 answers
  
  ### Answer by username_12 on 2017-06-16. Score: 48 | Accepted answer
  
  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 a 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](https://wiki.python.org/moin/PythonForArtificialIntelligence).
  
  Python has an easy implementation for OpenCV. What makes Python favorite 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.
  
  > **Comments:**
  > **username_15**: "They don't want to spend time on debugging the code for syntax errors" - Does any programmer want to do this? Is Python the best languge for everything? I am not convinced.  
  > **username_13**: Endless trade offs in all these areas: what python has in simplicity/built in libraries it can lose in stuff like speed, memory usage etc. Somewhat like vehicles - a simple automatic car is easy to learn to drive with and get around a city but won't get you very far in a race vs a race car, plane or an aircraft carrier. Can only try and pick the best tool for the problem.  
  > **username_14**: Python is without doubt a rapid language to prototype code in, but it may be said that i is a slow language to deliver in. It lacks support for programming in the large, but most 'AI' programming is akin to saying you are doing operating system development by writing a Windows GUI. Look at the documentation for setting up the file structure for a full project https://docs.python-guide.org/writing/structure/. It doesn't support multicore CPUs as it lacks modern multithreading. So you buy an expensive 8 core PC, use 1 core with code that runs 10 times slower than the same in a compiled language.  
  
  ---
  
  ### Answer by username_2 on 2018-05-23. Score: 9
  
  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
  
  > **Comments:**
  > **username_3**: Thanks for sharing. I would love if we have the summary on top and then full detail as yours after that.  
  
  ---
  
  ### Answer by username_7 on 2017-06-15. Score: 8
  
  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.
  
  > **Comments:**
  > **username_8**: Nice point about the interpretive capability of Python.  It seems like flexibility and development speed is strongly favored over the greater "horsepower" of compiled languages.  
  
  ---
  
  ### Answer by username_4 on 2019-02-01. Score: 4
  
  It's a mix of many factors that together make it a very good option to develop cognitive systems.
  
  * Quick development
  * Rapid prototyping
  * Friendly syntax with almost human-level readability
  * Diverse standard library and multi-paradigm
  * 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.
  
  
  ---
  
  ### Answer by username_5 on 2018-05-24. Score: 3
  
  That’s because python is a modern scripting object-oriented programming language that has stylish syntax. Contrary to structural programming languages like java and C++, its scripting nature enables the programmer to test his/her hypothesis very fast. Furthermore, there are lots of open source machine learning libraries (including scikit-learn and Keras) that broaden the use of python in AI field.
  
  
  ---
  
  ### Answer by username_6 on 2019-02-02. Score: 3
  
  Python has rich library, it is also object oriented, easy to program. It can be also used as frontend language. That's why it is used in artificial intelligence. Rather than AI it is also used in machine learning, soft computing, NLP programming and also used as web scripting or in Ethical hacking.
  
  
  ---
  
  ### Answer by username_9 on 2020-05-05. Score: 1
  
  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?
  
  > **Comments:**
  > **username_3**: You make clear sense! That's what Google see and invest into library in python to provide to those non-pro coding scientist  
  
  ---
  
  ### Answer by username_10 on 2019-11-01. Score: 1
  
  I actually prefer C for machine learning. Because like in life, in the world as we know it, consists of never-ending "logic gates" (which basically is like flipping a coin - there WILL be 2 possible outcomes - not counting the third: landing on the side!). Which also means that while the universe seems never-ending, we still never stop finding those things that are even smaller than the last smallest thing, right?
  
  So... To put it in a context when programming C, I can control the memory usage more efficiently by coding smaller snippets that get combined, to always form smaller & efficient "code-fragments", that make up what we would call "cells" in biology (it got a measurable function, and has some pre-set properties).
  
  Thus, I like to optimize for low RAM usage, low CPU usage etc. when programming AI. I have only done feedforward with a basic genetic algorithm in C, but the more advanced recurrent neural network I wrote in C++ (ONLY because of the simplicity of using `std::vector name;`, so I wrote my own `cvector.c`: <https://pastebin.com/sBbxmu9T> & `cvector.h`: <https://pastebin.com/Rd8B7mK4> & debug: <https://pastebin.com/kcGD8Fzf> - compile with `gcc -o debug debug.c cvector.c`). That actually helped a lot in the quest of optimizing CPU usage (and overall runtime) when creating optimized neural networks.
  
  **EDIT:**
  So I am in one sense really see the opposite of what AlexPnt sees, when it comes to exploring what is possible within the realm of a "self".
  
  
  ---
  
  ### Answer by username_11 on 2020-01-24. Score: 1
  
  We also work with Python in [our company](https://www.n-ix.com/python-development/). One of the sphere that we use it for is fast prototyping and building highly scalable web applications. For over two decades, our Python developers have been providing businesses with full-stack web-development services, client-server programming and administration. We help our clients build high-load web portals, automation plugins, high-performance data-driven enterprise systems, and many more.
  
  
  ---
  
  