Docsity

Lab 01: Introduction to Python IDEs, Lecture notes of Artificial Intelligence

Toggle sidebar
bg1
Lab 01: Introduction to Python IDEs
Contents:
1. Anaconda IDE
2. Jupyter Notebook
3. Spyder
4. Google Colab
5. Exercise
1. Anaconda IDE
What is ANACONDA?
Anaconda$is a distribution of the Python and R programming languages for scientific computing
(data science, machine learning applications, large-scale data processing, predictive analytics,
etc.), that aims to simplify package management and deployment.
Languages used:$Python
Software genre:$Programming language
Source of definition:
https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)#:~:text=Anaconda%20is%20a
%20distribution%20of,simplify%20package%20management%20and%20deployment.
How to start and set up the project in ANACONDA?
Install Anaconda, as any other software, by one click installation after downloading from the
following link
https://www.anaconda.com/products/individual
Start Anaconda :
Start Anaconda from Start Menue and it will look like this:
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Lab 01: Introduction to Python IDEs and more Lecture notes Artificial Intelligence in PDF only on Docsity!

Lab 01: Introduction to Python IDEs

Contents:

  1. Anaconda IDE
  2. Jupyter Notebook
  3. Spyder
  4. Google Colab
  5. Exercise

1. Anaconda IDE

What is ANACONDA?

Anaconda is a distribution of the Python and R programming languages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.), that aims to simplify package management and deployment. Languages used : Python Software genre : Programming language

Source of definition:

https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)#:~:text=Anaconda%20is%20a %20distribution%20of,simplify%20package%20management%20and%20deployment. How to start and set up the project in ANACONDA? Install Anaconda, as any other software, by one click installation after downloading from the following link https://www.anaconda.com/products/individual Start Anaconda :  Start Anaconda from Start Menue and it will look like this:

 Once it opens, the interface looks like this:  As we are going to use, for now, jupyter notebook:

 Use cd command to go to the specific folder where your project will be created  After jumping to the specific folder (e.g. “AI”), type “Jupyter notebook”. It will start Jupyter Notebook and prompt for selecting the browser of your choice (Chrome is recommended).  Following tab appears once the browser application is chosen:

 Create new project by clicking on New, and select Python 3:  You are now ready to code in the following window:

 Example ode in Code Panel  To run the code, select it and Play or press Shift+Enter. The output will be displayed as:

 Along the output console, displayed is variable console which shows variables and values.

3. Google Colab

What is Google Colab?

Colaboratory, or “Colab” for short, is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education. More technically, Colab is a hosted Jupyter notebook service that requires no setup to use, while providing free access to computing resources including GPUs.  Go to google and searc for https://colab.research.google.com/. The Colab prompts welcome screen:

 The new project file looks as following. Start coding:

 An example code looks as following:

Note: See highlighted part:

  1. Name is changed from Untitled2 to Name_Changed
  2. Aside from connect now, it is connected to Server
  3. And cell is run and the output is shown under the code line.

4. Basic Python Program

This section explains further on how to write a python program. Read comments carefully in the given screen shot. print() is used to output something on the console:

 To retrieve input from user, use input() function Note. Python does not need to define data type for input variable, it assigns the type based on data provided by the user. For example, in the program below, Python assigns string type to variable name , since user entered a string data.