PyCharm

is an intelligent IDE free for education

install anaconda first

install packages from within pycharm instead of by PIP

use scientific mode

start scientific mode(view a data-frame by right clicking on it to get the following interface

Get all the Scientific mode settings predefined by choosing the corresponding project type in the New Project wizard.

creating a new scientific project in PyCharm

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

JupyterLab: A Next-Generation Notebook Interface

It works in a browser and I experienced lack of consistency in compilation .

intellisense is not as good as Pycharm

 

https://jupyter.org/

“Preferred Installer Program” or PIP 

pip install jupyterlab

to start

jupyter lab

JupyterLab will open automatically in your browser.

Intellisense :  tab for properties      Shift+tab for syntax.

 

=-=-=-=-=-=-=-=-=-=-=-=-

URL: https://www.youtube.com/watch?v=_uQrJ0TkZlc

; is optional

indentation is part of the sytax

Python has no command for declaring a variable. A variable is created the moment you first assign a value to it.

Multiple line string

Amirstr=”’

Hi
How are you
Nice

”’

indexes start at 0

x=5

x+=3  is supported

# this is a comment

ishot=True;
if ishot: {print(“hot”)}
else: Print(“cold”)

Lists are assigned by reference

matrix=[[1,2],[3,4]]
print(matrix)
[[1, 2], [3, 4]]
tetrix=matrix
print(tetrix)
[[1, 2], [3, 4]]
matrix[1][1]=99
​print(tetrix)
[[1, 2], [3, 99]]

AmirDictionary={
“FN”:”amir”,
“LN”:”ghasemi”,
“EmpNum”:12345
}

print(AmirDictionary[“FN”])
amir

def My_function(aname,alastname):

print(aname+alastname)
print(f'{aname} {alastname} I love you’)

 

My_function(aname=”Azi”,alastname=”Jaan”)
AziJaan
Azi Jaan I love you

 

 

 

try:

a=1
b=”two”
c=a+b

except:

print(“nice”)

 

class AmirClass:
def __init__(self, fname, lname):
self.firstname = fname
self.lastname = lname

def printname(self):
print(self.firstname, self.lastname)

def say(self, this):
print(f'{this} is good’)

#Use the Person class to create an object, and then execute the printname method:

x = AmirClass(“John”, “Doe”)
x.printname()
x.say(“Amir”)
x.firstname

 

 

Machine Learning

NumPy  is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.

 

 

 

Since 11 April 2023: 685 total views,  5 views today