{"id":6223,"date":"2018-01-03T10:06:23","date_gmt":"2018-01-03T10:06:23","guid":{"rendered":"https:\/\/blog.cloudthat.com\/?p=6223"},"modified":"2024-06-25T11:11:31","modified_gmt":"2024-06-25T11:11:31","slug":"performing-python-data-science-on-azure","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/performing-python-data-science-on-azure","title":{"rendered":"Performing Python Data Science on Azure"},"content":{"rendered":"<p>In the past, programming has followed a general cycle involving write, compile, check and execute. Although this system has proved to be reliable, modern applications of programming possess alternate requirements. I have always been a proponent of text editors over IDEs. This is partly since I originally started coding with text editors and text editors ensured that I did not constantly look for auto-correct to help me. However, over time I realized that IDEs save a lot of time and its more about efficiency rather than practice. The issue was, after writing the code, the process of executing the code remained the same:<\/p>\n<p>1. Open the terminal<br \/>\n2. Compile and run<\/p>\n<p>When I started performing Data Science and Machine Learning, this process proved too cumbersome. For example, when I needed to visualize a dataset in Python, I would have to save the graph locally on my system, close the program and view the graph. Soon, I realized that this did not align with my philosophy of efficiency.<\/p>\n<div id=\"attachment_6230\" style=\"width: 222px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/notepad_plus_logo.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6230\" class=\"size-full wp-image-6230\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/notepad_plus_logo.png\" alt=\"\" width=\"212\" height=\"153\" \/><\/a><p id=\"caption-attachment-6230\" class=\"wp-caption-text\">Figure 1: Conventional programming techniques employed text editors such as Notepad++ or IDEs such as PyCharm<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>When it comes to Data Science, real-time interaction with the data is paramount. This enables Data Scientists to work dynamically with data and numbers. One such tool for Python is Jupyter. Jupyter Notebook is an open-source web app for interactive coding. The web app offers support for Python, Julia and Ruby.<\/p>\n<div id=\"attachment_6229\" style=\"width: 356px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/jupyter_logo.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6229\" class=\"size-full wp-image-6229\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/jupyter_logo.png\" alt=\"jupyter\" width=\"346\" height=\"346\" \/><\/a><p id=\"caption-attachment-6229\" class=\"wp-caption-text\">Figure 2: Jupyter is an open source web based tool for interactive Data Science and Machine Learning<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Each Jupyter Notebook consists of a back-end kernel known as IPython. The kernel analyses and runs your code. With Jupyter, multiple kernels are supported. As such, a custom kernel can be created based on one\u2019s requirements.<\/p>\n<p>During the initial stages of my foray into Data Science, I realized that I needed separate environments for different tasks. The availability of multiple kernels was a boon. I could set up TensorFlow and all its dependencies in one kernel and data visualization in another.<\/p>\n<div id=\"attachment_6228\" style=\"width: 410px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/IPython_logo.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6228\" class=\"size-full wp-image-6228\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/IPython_logo.jpg\" alt=\"IPython\" width=\"400\" height=\"225\" \/><\/a><p id=\"caption-attachment-6228\" class=\"wp-caption-text\">Figure 3: IPython forms the backbone of a Python Notebook<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>One of the biggest drawbacks of using Jupyter Notebooks for Python development or Data Science is that it is quite resource intensive. However, this drawback can be overcome with the help of <strong>Azure Notebooks<\/strong>. Azure Notebooks are Jupyter Notebooks that are hosted on the Cloud using Azure virtual machines.<\/p>\n<div id=\"attachment_6224\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/azure_notebook-e1513846424972.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6224\" class=\"wp-image-6224 size-full\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/azure_notebook-e1513846424972.png\" alt=\"Azure Notebook\" width=\"600\" height=\"291\" \/><\/a><p id=\"caption-attachment-6224\" class=\"wp-caption-text\">Figure 4: Azure Notebooks are Jupyter Notebooks that are hosted on Azure<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Access and use of Azure Notebooks is completely free and you need not possess an Azure account to access these resources. Apart from the cost benefit, Azure Notebooks come pre-installed with a variety of different packages that aid in Data Science. Additional packages can also be installed through the Jupyter front-end interface with the use of <strong>magic commands<\/strong>. The packages that comes installed include the entire <strong>Anaconda<\/strong> stack as well as numerous Microsoft specific modules such as CNTK and Azure ARM.<\/p>\n<div id=\"attachment_6225\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/azure_notebook_1-e1513846461419.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6225\" class=\"wp-image-6225 size-full\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/azure_notebook_1-e1513846461419.png\" alt=\"Azure Notebook\" width=\"600\" height=\"267\" \/><\/a><p id=\"caption-attachment-6225\" class=\"wp-caption-text\">Figure 5: Azure notebooks come with a wide range of packages pre-installed<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Another major benefit of using Azure Notebooks is that the tool does not exclusively feature Python. It also has support for R and F#. Microsoft has also loaded Azure Notebooks with a plethora of study and practice material in form of notebooks that enables users to approach Data Science and programming in an interactive manner. I found myself constantly going through the sample notebooks to find new and interesting ways to use Jupyter and Azure.<\/p>\n<p>Jupyter Notebooks can also be imported from fellow Azure Notebook users or from GitHub ensuring that one has the fastest possible method to pull resources. The terminal for the machine hosting the Jupyter Notebook can also be accessed.<\/p>\n<div id=\"attachment_6226\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/azure_notebook_library-e1513846130558.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6226\" class=\"wp-image-6226 size-full\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/azure_notebook_library-e1513846130558.png\" alt=\"Azure Notebook Library\" width=\"600\" height=\"284\" \/><\/a><p id=\"caption-attachment-6226\" class=\"wp-caption-text\">Figure 6: &#8220;Libraries&#8221; can be easily shared via GitHub or within Azure Notebooks<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Although Azure Notebooks act independently of Microsoft Azure, the two services are closely intertwined. The Azure Notebooks service is deployed when one attempts to visualize data or make Python code specific changes in Azure Machine Learning Studio. Veterans in the interactive Data Science sphere will feel right at home on Azure Notebooks.<\/p>\n<p>What do you use for Data Science? We would love to hear about the new technologies or tools that you use. Let us know in the comments section.<\/p>\n<p>To know about our service offerings, kindly visit <a href=\"http:\/\/www.cloudthat.in?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=performing-python-data-science-on-azure\" target=\"_blank\" rel=\"noopener\">www.cloudthat.in<\/a> (for training services) and <a href=\"http:\/\/www.cloudthat.com?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=performing-python-data-science-on-azure\" target=\"_blank\" rel=\"noopener\">www.cloudthat.com<\/a> (for consulting services)<\/p>\n","protected":false},"author":219,"featured_media":6238,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3608,3607],"user_email":"prarthitm@cloudthat.com","published_by":"324","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/6223"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/219"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=6223"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/6223\/revisions"}],"predecessor-version":[{"id":46041,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/6223\/revisions\/46041"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=6223"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=6223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}