Swapnil Saurav

Programming with Hari

Access all videos from here

print(‘Hello’)
print()   #comment is for human being
#sdfsdfdsfsdfdsf
print(‘hello again hhjvjbhjhlbbuihuhuhuhu’)
print(‘5+3’)
print(5+3)
print(“4+6=”,4+6)

# y = x + 5, find y when x is 3

# 5 is constant – you cant change its value
# x, y are variables – their values can change
# y dependent variable because its value depends on x
# x is independent variable because you can assign any value to it

x = 3
y = x+ 5
print(“When X is “,x,“then Y is “,y)

# write a program to calculate area of a rectangle


l = 5
b = 8
area = l * b
print(” Length is”,l,“breadth is”,b,“and area is”,area)
# f-string format string
print(f“Length is {l} and breadth is {b} so the area is {area})

#calculate area and circumference of a circle and print the output as:
# Circle with a radius will have area of area and circumference of circumference
# arithematic
val1 , val2 = 25,20
print(val1 + val2)
print(val1 – val2)
print(val1 * val2)
print(val1 / val2)
print(val1 // val2) # integer division
print(val1 % val2) # mod – remainder
print(5 ** 3) #power

#relational operators: > < >= <= == !=
#output is always – True or False
val1, val2, val3 = 25,20,25
print(val1 > val2) #T
print(val1 > val3) #F
print(val1 >= val3) #T
print(val1 < val2) #F
print(val1 < val3) #F
print(val1 <= val3) #T
print(val1 == val2) #F
print(val1 != val3) #F
print(val1 == val3) #T

# Logical operators: input &output are bool: and , or, not
print(“Logical operators”)
print(True and True) #I did both the tasks
print(False and True)
print(True and False)
print(False and False)

print(True or True) #T
print(False or True) #T
print(True or False) #T
print(False or False) #F

print(not True)
print(not False)

r= –5
if r>0:
area = 22/7*(r**2)
print(“area of the circle is”,area)
else:
print(“Invalid data”)

num=4
if num>0:
print(“Positive”)
elif num<0:
print(“Negative”)
else:
print(“Neither positive not negative”)
# wap to check if a number is divisible by 3 or not
# wap to check if a number is odd or even
# for: when you know how many times you need to repeat something
# while:
# range(=start, < end, =increment) range(3,9,2): 3,5,7
for counter in range(3,9,2):
print(“HELLO, The counter value is”,counter)
##
for i in range(1,101): #when increment is not given, default value is 1
print(i)


#Generate even numbers from 2 to 100 (both inclusive)
n=12
for i in range(n): #when start number is not given, default value is zero
print(“* “,end=“”)
print()

”’
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
”’
for j in range(n):
for i in range(n):
print(“* “,end=“”)
print()

”’
*
* *
* * *
* * * *
”’
for j in range(n):
for i in range(j+1):
print(“* “,end=“”)
print()

”’
* * * *
* * *
* *
*
”’
for j in range(n):
for i in range(n-j):
print(“* “,end=“”)
print()

”’
* * * *
*
*
* * * *
”’
for j in range(n):
if j==0 or j==n-1:
for i in range(n):
print(“* “,end=“”)
print()
else:
for k in range(n-j-1):
print(” “,end=” “)
print(“*”)


#while
cont = “y”
while cont==“y”:
print(“Hello from While”)
cont = input(“Do you want to continue: hit y for yes anyother key for no:”)
num = 10
while num >0:
print(“hello”)
num=num-1

ch=‘y’
while ch==‘y’ or ch==“Y”:
print(“I am fine”)
ch=input(“Do you want to continue (y for yes):”)

while True:
print(“How are you?”)
ch=input(“Enter n to stop:”)
if ch==“n”:
break #that will throw you out of the loop

# guessing game
num = 45

while True:
guess = int(input(“Guess the number (1-100): “))
if guess<1 or guess>100:
continue
if num==guess:
print(“Congratulations… You have guessed it correctly!”)
break
elif num<guess:
print(“Incorrect! You have guessed higher number”)
else:
print(“Incorrect! You have guessed lower number”)

## Menu Options
print(“WELCOME TO MY LIBRARY APPLICATION”)
while True:
print(“1. Issue the Book”)
print(“2. Return the Book”)
print(“3. Add new Book to the library”)
print(“4. Remove a book from the library”)
print(“5. Exit”)
choice = input(“Enter you choice: “)
if choice==“1”:
print(“Given book has been issued!”)
elif choice==“2”:
print(“Book has been returned to the library!”)
elif choice==“3”:
print(“Added the book to the library!”)
elif choice==“4”:
print(“Removed the book from the library database!”)
elif choice==“5”:
print(“Have a good day!”)
break
else:
print(“Invalid option! Try again”)
continue
####
str1 = 'HELLO'
str2 = "I am fine"
str3 = '''Where are you going?
How long will you be here?
What are you going to do?'''
str4 = """I am here
I will be here for next 7 days
I am going to just relax and chill"""
print(type(str1),type(str2),type(str3),type(str4))
print(str1)
print(str2)
print(str3)
print(str4)

# What's you name?
str5 = "What's your name?"
print(str5)
#He asked,"Where are you?"
str6 = 'He asked,"Where are you?"'
print(str6)

#He asked,"What's your name?"
#escape sequence \
print('''He asked,"What's your name?"''')
print("He asked,\"What's your name?\"")

print('nnnnn\nnn\tnn')

print("\FOlder\\newfolder")
# \n is used to print newline in python
print("\\n is used to print newline in python")

# \\n will not print newline in python
print("\\\\n will not print newline in python")

str1 = "Hello You"
str2 = "There"
print(str1 + str2)
print(str1 *5)
for i in str1:
print("Hello")

#indexing
print(str1[2])
print("last element: ",str1[4])
print("last element: ",str1[-1])
print("second element: ",str1[-8])
print("ell: ",str1[1:4])
print("ell: ",str1[-8:-5])
print("First 3: ",str1[:3])
print("First 3: ",str1[:-6])
print("Last 3: ",str1[6:])
print("Last 3: ",str1[-3:])

#Methods - exactly same as your functions - only difference is they are linked to a class
import time
str1 = "HELLO"
print(str1.replace("L","X",1))

sub_str = "LL"
str2 = "HELLO HOW WELL ARE YOU LL"
cnt = str2.find(sub_str)
print("Count = ",cnt)

if cnt<0:
print("Sorry, no matching value hence removing")
else:
print("Value found, now replacing")
for i in range(5):
print(". ",end="")
time.sleep(0.5)
print("\n")
print(str2.replace(sub_str,"OOOO"))


out_res = str2.split("LL")
print("Output Result = ",out_res)

out_str = "LL".join(out_res)
print(out_str)

print(str2.title())
print(str2.lower())
print(str2.upper())

str3 = 'hello how well are you ll'
print(str3.islower())
print(str3.isupper())

num1 = input("Enter a number: ")
if num1.isdigit():
num1 = int(num1)
else:
print("Invaid input")

ename = input("Enter your first name: ")
if ename.isalpha():
print("Your name is being saved...")
else:
print("Invaid name")

#WAP to count of vowels in a sentence
para1 = "Work, family, and endless to-do lists can make it tough to find the time to catch up. But you'll never regret taking a break to chat with your friend, Frost reminds us. Everything else will still be there later."
sum=0
for l in para1:
if l=='a' or l=='A' or l=='e' or l=='E' or l=='i' or l=='I' or l=='o' or l=='O' or l=='u' or l=='3':
sum+=1
print("Total vowesl = ",sum)
sum=0
for l in para1.lower():
if l=='a' or l=='e' or l=='i' or l=='o' or l=='u':
sum+=1
print("Total vowesl = ",sum)

sum=0
for l in para1.lower():
if l in 'aeiou':
sum+=1
print("Total vowesl = ",sum)
#Strings – indexing
str1 = “Hello”
print(“=>”, str1[0]+str1[2]+str1[4])

#methods in Python
print(str1.isdigit())

num1 = input(“Enter a number: “)
if num1.isdigit():
num1 = int(num1)
print(num1)
else:
print(“Sorry you have entered a invalid number”)

username = “abcd3456”
if username.isalnum():
print(“Valid username”)
else:
print(“Username is not valid, enter again!”)
username=“abcd”
print(“alpha: “,username.isalpha())
print(“isalnum: “,username.isalnum())
print(“isdigit: “, username.isdigit())
txt1 = “Hello how are you are you are doing”
print(“lower: “,txt1.islower()) #isupper(), istitle()
print(“title: “,txt1.title())
print(“title: “,txt1.istitle())
# islower() -> lower(), isupper() -> upper(), istitle() -> title()
print(“=> “,txt1.split())
print(“=> “,txt1.split(“o”))
txt_list1 = [‘Hello’, ‘how’, ‘are’, ‘you’, ‘doing’]
txt_list2 = [‘Hell’, ‘ h’, ‘w are y’, ‘u d’, ‘ing’]
print(“Join = “, ” “.join(txt_list1))
print(“Join = “, “o”.join(txt_list2))
print(“”,txt1.count(“are”,10,25))
print(“”,txt1.count(“hello”))
print(” “,txt1.replace(“are”,“is”))

COMPLETE THE PYTHON COURSE FROM HERE:

https://www.netacad.com/

Direct course link: https://www.netacad.com/courses/programming/pcap-programming-essentials-python

# List: linear ordered mutable collection
list1 = [5,6.1,“Hello”,True,[2,4,9]]

# mutable means you can edit the list
list1[1] = 6.9
print(“List 1 = “,list1)

# non mutables (immutable) objects cant be edited eg. String
str1 = “Hello”
#str1[1]= “Z” #TypeError: ‘str’ object does not support item assignment
print(“You can iterate through the list:”)
for i in list1:
print(i)

list2 = [3,6,9,12]
list3 = [4,8,12,16]
print(“list2 + list3: “,list2 + list3)

print(“last member = “,list1[-1])
print(“First 4 values = “,list1[:4])
print(“Number of elements in List 1 = “,len(list1))

### Methods in List ###
list2 = [3,6,9,12]
list2.append(18)
print(“List 2 after append: “,list2)
list2.append(15)
print(“List 2 after append 2: “,list2)

# add the element at a specific position
list2.insert(1,24)
print(“List 2 after insert: “,list2)

## removing
list2.pop(2) #pop takes the index value
print(“List 2 after pop: “,list2)
list2.remove(18) #remove takes the value of the element to remove
print(“List 2 after remove: “,list2)

list4 = list2
list5 = list2.copy()
print(“1. List 2 = “,list2)
print(“1. List 4 = “,list4)
print(“1. List 5 = “,list5)
list2.append(30)
list2.append(40)
print(“2. List 2 = “,list2)
print(“2. List 4 = “,list4)
print(“2. List 5 = “,list5)

print(“10 in the list = “,list2.count(10))
list2.reverse()
print(“List after reverse = “,list2)
list2.sort() #sort in the ascending order
print(“Sorted list = “,list2)

list2.sort(reverse=True) #sort in the descending order
print(“Sorted list = “,list2)

list2.clear()
print(“List after clear = “,list2)
# Tuples – linear ordered immutable collection

t1 = (4,6,7,8)
print(type(t1))
for i in t1:
print(i)
t1 = list(t1)
t1.append(10)
t1 = tuple(t1)
# Dictionary : key:value pair

dict1 = {}
print(type(dict1))
dict1 = {3:“Sachin”,“Second”:2,True:False,“Flag”:True}
# 3 ways – keys, values, items
for k in dict1.keys(): #keys
print(“Key = “,k,” and value is”,dict1[k])
for values in dict1.values():
print(“Value is”,values)

# iterate through items:
for item in dict1.items():
print(item,“: key is”,item[0],“and value is”,item[1])

# only a dictionary can be added to a dictionary
temp = {“City”:“Mumbai”}
dict1.update(temp)
print(“Dictionary 1: “,dict1)

#dictionary – mutable [list is mutable, tuple and string – immutable]
dict1[3]=“Tendulkar”
print(“Dictionary 1: “,dict1)

#copy
dict2 = dict1
dict3 = dict1.copy()
print(“1. Dict1 = “,dict1)
print(“1. Dict2 = “,dict2)
print(“1. Dict3 = “,dict3)
dict1.update({“Team”:“India”})
dict3.update({“Runs”: 12908})
dict2.update({“Wickets”: 432})

print(“2. Dict1 = “,dict1)
print(“2. Dict2 = “,dict2)
print(“2. Dict3 = “,dict3)

dict1.clear()
print(dict1)
Django Learning with Jeswanth

All videos are available here:    https://www.youtube.com/playlist?list=PLF9fJE4vTtTLnXYzr_19r1NVRWuNV892t

Access all the videos here

BASIC INFORMATION

For Basic information like installation, software to use, history, refer this link:

#Server DB Server(Modal – SQL) Controller (Python) View (HTML, Javascript)

print(‘Hello There’);print(“How are you?”)

print(5+3);
print ( “5+3=”,5+3,“and 6*2 =”, 6*2 )
# y = x+5, find the value of y when x is 4
# 5 is constant – value will remain 5
# x,y – their value can change – variables
# x independent variable, we can put any value
# y is dependent variable (on x), it can take multiple values but that depends on x

#calculate area and perimeter of a rectangle
l=50
b=85
#input values
# input – process (formula) – output (display the result)
area = l * b
perimeter = 2*(l+b)
print(“Rectangle with length”,l,“and breadth”,b,“has an area of”,area,“and perimeter of”,perimeter)

# f-string – formatting the string
print(f”Rectangle with length {l} and breadth {b} has an area of {area} and perimeter of {perimeter})

#calculate area and circumference of a circle
#independent variable here is radius
r = 13
area = 3.14 * r * r #pi is constant value 3.14
c = 2*3.14*r
#area and c are dependent variables
print(“Circle with radius”,r,“will have area of”,area,“and circumference of”,c)
print(f”Circle with radius {r} will have area of {area:.1f} and circumference of {c:.4f})

name,team,pos=“Virat”,“India”,“Captain”
print(f”Player’s name is {name:<10} from the team {team:^10} and represents as {pos:>15} at the event.”)
name,team,pos=“Manbgwabe”,“Zimbabwe”,“Wicket-Keeper”
print(f”Player’s name is {name:<10} from the team {team:^10} and represents as {pos:>15} at the event.”)

#numeric data types – int, float n complex
var1 = 50 #int – integer, numbers without decimal point
print(type(var1)) #type() – will give the type of the data that is stored
var1 = 50.0 #float
print(type(var1))
var1 = 5j # complex
# square root of -1 : i (in python we say j)
print(type(var1))
print(5j * 5j)
#text type – string (str)
”’ This is a
multi line
comment in python”’
var1 =‘5’
print(type(var1)) #<class ‘str’>
var1 = True #bool – True or False
print(type(var1))
# 5 types: int, float, bool, str,complex
#arithematic
val1, val2 = 20,3
print(val1 + val2) #adding
print(val1 – val2) #subtracting
print(val1 * val2) #multiplying
print(val1 / val2) #dividing – gives a float value
print(val1 // val2) # integer division – gives integer value
print(val1 ** val2) #power
print(val1 % val2) #mod – remainder

# 20/3 = 6 2/3
#conditional / relational operators: > < >= <= == !=
# output: True or False
val1, val2,val3 = 20,3,20
print(val1 > val2) #True
print(val1 >= val3) #T
print(val1 > val3) # F
print(val1 < val3) #
print(val1 <= val3) #T
print(val1 == val3)
print(val1 != val3)

# logical operator: and or not
#input is boolean and output is also boolean
print(False and False)
print(False and True)
print(True and False)
print(True and True)
print(“===============”)

print(False or False)
print(False or True)
print(True or False)
print(True or True)
print(not True)
print(not False)
print(“========”)
val1, val2,val3 = 20,3,20
print(val1 >= val3 and val1 > val3 or val1 < val3 and val1 <= val3 or val1 == val3)
# T
num= 0
if num>0:
print(“Positive”)
elif num<0:
print(“Negative”)
else:
pass

print(“Thank you”)

####
avg =75
#avg>=85: Grade A, 70-85: Grade B, 60 to 70: Grade C, 50-60: D, <50: E
# if avg>=50: You have passed!
if avg>=50:
print(“You’ve passed!”)
if avg >= 70:
print(“Grade A”)
if avg>=90:
print(“You win special award”)
elif avg >= 85:
print(“Grade B”)
elif avg >= 60:
print(“Grade C”)
else:
print(“Grade D”)
else:
print(“You’ve not passed!”)
print(“Grade E”)
#LOOPS – repeating a block of code
## FOR Loop: used when you know how many times to execute a code
## WHILE Loop: beforehand you are not sure how many times but repeat based on some condition
# for: when you know how many times you need to repeat something
# while:
# range(=start, < end, =increment) range(3,9,2): 3,5,7
for counter in range(3,9,2):
print(“HELLO, The counter value is”,counter)
##
for i in range(1,101): #when increment is not given, default value is 1
print(i)


#Generate even numbers from 2 to 100 (both inclusive)
n=12
for i in range(n): #when start number is not given, default value is zero
print(“* “,end=“”)
print()

”’
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
”’
for j in range(n):
for i in range(n):
print(“* “,end=“”)
print()

”’
*
* *
* * *
* * * *
”’
for j in range(n):
for i in range(j+1):
print(“* “,end=“”)
print()

”’
* * * *
* * *
* *
*
”’
for j in range(n):
for i in range(n-j):
print(“* “,end=“”)
print()

”’
* * * *
*
*
* * * *
”’
for j in range(n):
if j==0 or j==n-1:
for i in range(n):
print(“* “,end=“”)
print()
else:
for k in range(n-j-1):
print(” “,end=” “)
print(“*”)


#while
cont = “y”
while cont==“y”:
print(“Hello from While”)
cont = input(“Do you want to continue: hit y for yes anyother key for no:”)
SQL Tutorial March 2023

SQL Programming - Sessions

select * from hr.employees;

 

Select first_name, last_name, email from hr.employees;

 

Select first_name, last_name, email,salary from hr.employees where salary > 7000;

 

select first_name || ‘ ‘ ||last_name “FULL NAME”, email “EMAIL ID”,salary from hr.employees where salary > 7000; 

 

Select first_name name, last_name last,salary, DEPARTMENT_ID from hr.employees  where salary > 7000 and DEPARTMENT_ID=100; 

 

Select first_name name, last_name last,salary, DEPARTMENT_ID from hr.employees  where salary > 7000 or DEPARTMENT_ID=100;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where COMMISSION_PCT IS NOT NULL;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where COMMISSION_PCT <> NULL;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 and last_name =’Tuvault’;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 and first_name like’A%’;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 and first_name like’%t%t%’;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 order by first_name;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 order by first_name desc;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 order by DEPARTMENT_ID, first_name;

 

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100 order by DEPARTMENT_ID, first_name;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees order by COMMISSION_PCT NULLS FIRST;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees order by COMMISSION_PCT DESC

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID <> 100;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID > 100;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID < 100;

 

Select first_name name, last_name last,salary, DEPARTMENT_ID, COMMISSION_PCT from hr.employees where DEPARTMENT_ID = 100;

 

select * from hr.employees; 

 

select * from dual;

— Functions that work on rows

select abs(-99), round(45.61) from dual; 

 

select to_number(‘12345.12678′,’99999.99999’) from dual;

select ‘12345.12678’ from dual;

 

—  12-Jan-2023

 

select to_date(‘May 15, 2023 5:25 P.M.’,’Month dd, yyyy HH:MI P.M.’) from dual;

 

select to_char(to_date(’11 January, 2023 5:25 P.M.’,’HH Month, yyyy DD:MI P.M.’), ‘Mon dd yyyy hh:mi’) from dual;

 

select first_name, last_name, hire_date, to_char(hire_date, ‘Month dd yyyy hh:mi’), salary, to_char(salary,’$99,999.9′) from hr.employees;

 

— DECODE

 

select decode(5+3,9,’Correct’,’Incorrect’)  from dual;

 

— AGGREAGATE Functions – that work on columns

select count(*), round(avg(salary)), sum(salary), min(salary), max(salary) ,DEPARTMENT_ID from hr.employees group by DEPARTMENT_ID having avg(salary) > 7000;

 

Select * from hr.employees;

 

select * from hr.departments;

 

— Cartesian

select first_name, last_name, e.DEPARTMENT_ID, DEPARTMENT_NAME from hr.employees e , hr.departments d

    

select first_name, last_name, e.DEPARTMENT_ID, DEPARTMENT_NAME from hr.employees e join hr.departments d  on (e.DEPARTMENT_ID=d.department_ID)

 

— Right Outer

select first_name, last_name, e.DEPARTMENT_ID, DEPARTMENT_NAME from hr.employees e , hr.departments d  where e.DEPARTMENT_ID (+)=d.department_ID

 

— Left Outer

select first_name, last_name, e.DEPARTMENT_ID, DEPARTMENT_NAME from hr.employees e , hr.departments d  where e.DEPARTMENT_ID =d.department_ID (+)

 

— FULL OUTER

select first_name, last_name, e.DEPARTMENT_ID, DEPARTMENT_NAME from hr.employees e full outer join hr.departments d  on (e.DEPARTMENT_ID=d.department_ID)

 

 

— Sub query

select * from HR.employees where first_name in (select first_name from hr.employees where salary>6000)

 

select * from HR.employees where department_ID = (select department_ID from hr.departments where department_name=’Shipping’)

 

select * from HR.employees e, hr.departments d where e.DEPARTMENT_ID =d.department_ID and d.department_name = ‘Shipping’

 
OSError errno22 invalid argument in Python

What is OSError?
OSError is the type of error in OSError : [errno22] invalid argument. OSError is an error class for the OS module. It is a built-in exception in python, which is raised. It is raised when the error occurs due to some system failure. I/O failures also give rise to OSErrors.

When the disk is full, or the file cannot be found, OSError is raised. The subclasses of OSError are BlockingIOError, ChildProcessError, ConnectionError, FileExistsError, FileNotFoundError, etc. OSError itself is derived from the EnvironmentError.

What is errorno22 invalid argument?
As the name suggests, invalid argument errors occur when an invalid argument is passed to a function. If a function was expecting an argument of a particular data type but instead received an argument of a different data type, it will throw an invalid argument error.

import tensorflow as tf
tf.reshape(1,2)

This code will raise invalid argument error. The tf.reshape() function was expecting a tensor as an argument. But instead, it received 1 and 2 as the argument.

‘OSError : [errno22] invalid argument’ while using read_csv()
Read_csv() is a function in pandas which is used to read a csv file in python. We can read a csv file by accessing it through a URL or even locally. While reading a csv file using read_csv, python can throw OSError : [errno22] invalid argument error.

Let us try to understand it with the help of an example. The below code has been executed in python shell to access local files. First, we shall import the pandas file to use read_csv()

import pandas as pd
file = read_csv(“C:\textfile.csv”)

The above line of code will raise the below error.

OSError: [Errno 22] Invalid argument: ‘C:\textfile.csv’
The reason behind the error is that python does not consider the backslash. Because of that, it showed oserror invalid argument. So what we have to do is that instead of a backslash, we have to replace it with a forwarding slash.

Correct method:
file = read_csv(“C:/textfile.csv”)

‘OSError : [errno22] invalid argument’ while using open()
We can get OSError : [errno22] invalid argument error while opening files with the open() function. The open() function in python is used for opening a file. It returns a file object. Thus, we can open the file in read, write, create or append mode.
Let us understand the error by taking an example. We shall try to open a .txt file in read mode using open(). The file would be returned as an object and saved in variable ‘f’.

f = open(“C:\textfile.txt”,”r”)

The code will throw the below error.

Traceback (most recent call last):
File “”, line 1, in
f = open(“C:\textfile.txt”,”r”)
OSError: [Errno 22] Invalid argument: ‘C:\textfile.

The OSError : [errno22] invalid argument error has been thrown because of the same reason as before. Here also, python fails to recognize the backslash symbol. On replacing backslash with forward slash, the error will be resolved.

Correct format:
f = open(“C:/textfile.txt”,”r”)

‘OSError : [errno22] invalid argument’ while reading image using open()
The above error can appear while opening an image using the open() function even though the backslash character has been replaced with forward slash. Let us see the error using an example.

image = open(“C:/image1.jpg”)

The error thrown would be:

Traceback (most recent call last):
File “”, line 1, in
image = open(“‪C:/image1.jpg”)
OSError: [Errno 22] Invalid argument: ‘\u202aC:/image1.jpg’

This error mainly occurs because of the copying of the file path. The Unicode characters also get copied sometimes when we copy the file path from our local system or the internet.

The Unicode character, ‘\u202a’ in the above example, is not visible in the file pathname. ‘\u202a’ is the Unicode control character from left to right embedding. So, it causes the above oserror invalid arguments.

The solution to this is straightforward. We simply have to type the URL manually instead of copying it. Thus, the Unicode character will no longer be in the URL and the error will be resolved.

What do you think? Please share in the comment section.

Installating R Studio

The RStudio IDE is a set of integrated tools designed to help you be more productive with R and Python. It includes a console, syntax-highlighting editor that supports direct code execution, and a variety of robust tools for plotting, viewing history, debugging and managing your workspace.

LEARN MORE ABOUT THE RSTUDIO IDE

If you want to start practicing r programs then R Studio is the best IDE. In this section, I will write the steps on how you can install RStudio Desktop for your personal use. RStudio Desktop is totally free to use.

Steps:

  1. First install R
  2. Install R Studio Desktop

To Install R:

  1. Open an internet browser and go to www.r-project.org.
  2. Click the “download R” link in the middle of the page under “Getting Started.”
  3. Select a CRAN location (a mirror site) and click the corresponding link.  
  4. Click on the “Download R for Windows” link at the top of the page.  
  5. Click on the “install R for the first time” link at the top of the page.
  6. Click “Download R for Windows” and save the executable file somewhere on your computer.  Run the .exe file and follow the installation instructions.  
  7. Now that R is installed, you need to download and install RStudio. 

To Install RStudio

  1. Go to www.rstudio.com and click on the “Download RStudio” button.
  2. Click on “Download RStudio Desktop.”
  3. Click on the version recommended for your system, or the latest Windows version, and save the executable file.  Run the .exe file and follow the installation instructions.     

I hope you have installed R and R studio and now you are ready to practice your programs.

Terms and Conditions

TERMS OF SERVICES

PLEASE READ THIS TERMS OF SERVICE AGREEMENT CAREFULLY, AS IT CONTAINS IMPORTANT INFORMATION REGARDING YOUR LEGAL RIGHTS AND REMEDIES.Last Revised: 2021-09-18 04:37:26

1. OVERVIEW

This Terms of Service Agreement (“Agreement”) is entered into by and between swapnil.pw, registered address Hyderabad, India (“Company”) and you, and is made effective as of the date of your use of this website http://swapnil.pw (“Site”) or the date of electronic acceptance.This Agreement sets forth the general terms and conditions of your use of the http://swapnil.pw as well as the products and/or services purchased or accessed through this Site (the “Services”).Whether you are simply browsing or using this Site or purchase Services, your use of this Site and your electronic acceptance of this Agreement signifies that you have read, understand, acknowledge and agree to be bound by this Agreement our Privacy policy. The terms “we”, “us” or “our” shall refer to Company. The terms “you”, “your”, “User” or “customer” shall refer to any individual or entity who accepts this Agreement, uses our Site, has access or uses the Services. Nothing in this Agreement shall be deemed to confer any third-party rights or benefits.Company may, in its sole and absolute discretion, change or modify this Agreement, and any policies or agreements which are incorporated herein, at any time, and such changes or modifications shall be effective immediately upon posting to this Site. Your use of this Site or the Services after such changes or modifications have been made shall constitute your acceptance of this Agreement as last revised.IF YOU DO NOT AGREE TO BE BOUND BY THIS AGREEMENT AS LAST REVISED, DO NOT USE (OR CONTINUE TO USE) THIS SITE OR THE SERVICES.

2. ELIGIBILITY

This Site and the Services are available only to Users who can form legally binding contracts under applicable law. By using this Site or the Services, you represent and warrant that you are (i) at least eighteen (18) years of age, (ii) otherwise recognized as being able to form legally binding contracts under applicable law, and (iii) are not a person barred from purchasing or receiving the Services found under the laws of the India or other applicable jurisdiction.If you are entering into this Agreement on behalf of a company or any corporate entity, you represent and warrant that you have the legal authority to bind such corporate entity to the terms and conditions contained in this Agreement, in which case the terms “you”, “your”, “User” or “customer” shall refer to such corporate entity. If, after your electronic acceptance of this Agreement, Company finds that you do not have the legal authority to bind such corporate entity, you will be personally responsible for the obligations contained in this Agreement.

3. RULES OF USER CONDUCT

By using this Site You acknowledge and agree that:

  • Your use of this Site, including any content you submit, will comply with this Agreement and all applicable local, state, national and international laws, rules and regulations.

You will not use this Site in a manner that:

  • Is illegal, or promotes or encourages illegal activity;
  • Promotes, encourages or engages in child pornography or the exploitation of children;
  • Promotes, encourages or engages in terrorism, violence against people, animals, or property;
  • Promotes, encourages or engages in any spam or other unsolicited bulk email, or computer or network hacking or cracking;
  • Infringes on the intellectual property rights of another User or any other person or entity;
  • Violates the privacy or publicity rights of another User or any other person or entity, or breaches any duty of confidentiality that you owe to another User or any other person or entity;
  • Interferes with the operation of this Site;
  • Contains or installs any viruses, worms, bugs, Trojan horses, Cryptocurrency Miners or other code, files or programs designed to, or capable of, using many resources, disrupting, damaging, or limiting the functionality of any software or hardware.

You will not:

  • copy or distribute in any medium any part of this Site, except where expressly authorized by Company,
  • copy or duplicate this Terms of Services agreement, which was created with the help of the TermsHub Terms and Conditions Generator,
  • modify or alter any part of this Site or any of its related technologies,
  • access Companies Content (as defined below) or User Content through any technology or means other than through this Site itself.

4. INTELLECTUAL PROPERTY

In addition to the general rules above, the provisions in this Section apply specifically to your use of Companies Content posted to Site. Companies Content on this Site, including without limitation the text, software, scripts, source code, API, graphics, photos, sounds, music, videos and interactive features and the trademarks, service marks and logos contained therein (“Companies Content”), are owned by or licensed to swapnil.pw in perpetuity, and are subject to copyright, trademark, and/or patent protection.Companies Content is provided to you “as is”, “as available” and “with all faults” for your information and personal, non-commercial use only and may not be downloaded, copied, reproduced, distributed, transmitted, broadcast, displayed, sold, licensed, or otherwise exploited for any purposes whatsoever without the express prior written consent of Company. No right or license under any copyright, trademark, patent, or other proprietary right or license is granted by this Agreement.

5. YOUR USE OF USER CONTENT

Some of the features of this Site may allow Users to view, post, publish, share, or manage (a) ideas, opinions, recommendations, or advice (“User Submissions”), or (b) literary, artistic, musical, or other content, including but not limited to photos and videos (together with User Submissions, “User Content”). By posting or publishing User Content to this Site, you represent and warrant to Company that (i) you have all necessary rights to distribute User Content via this Site or via the Services, either because you are the author of the User Content and have the right to distribute the same, or because you have the appropriate distribution rights, licenses, consents, and/or permissions to use, in writing, from the copyright or other owner of the User Content, and (ii) the User Content does not violate the rights of any third party.You agree not to circumvent, disable or otherwise interfere with the security-related features of this Site (including without limitation those features that prevent or restrict use or copying of any Companies Content or User Content) or enforce limitations on the use of this Site, the Companies Content or the User Content therein.

6. COMPANIES USE OF USER CONTENT

The provisions in this Section apply specifically to Companies use of User Content posted to Site.You shall be solely responsible for any and all of your User Content or User Content that is submitted by you, and the consequences of, and requirements for, distributing it.With Respect to User Submissions, you acknowledge and agree that:

  • Your User Submissions are entirely voluntary.
  • Your User Submissions do not establish a confidential relationship or obligate Company to treat your User Submissions as confidential or secret.
  • Company has no obligation, either express or implied, to develop or use your User Submissions, and no compensation is due to you or to anyone else for any intentional or unintentional use of your User Submissions.

Company shall own exclusive rights (including all intellectual property and other proprietary rights) to any User Submissions posted to this Site, and shall be entitled to the unrestricted use and dissemination of any User Submissions posted to this Site for any purpose, commercial or otherwise, without acknowledgment or compensation to you or to anyone else.With Respect to User Content, by posting or publishing User Content to this Site, you authorize Company to use the intellectual property and other proprietary rights in and to your User Content to enable inclusion and use of the User Content in the manner contemplated by this Site and this Agreement.You hereby grant Company a worldwide, non-exclusive, royalty-free, sublicensable, and transferable license to use, reproduce, distribute, prepare derivative works of, combine with other works, display, and perform your User Content in connection with this Site, including without limitation for promoting and redistributing all or part of this Site in any media formats and through any media channels without restrictions of any kind and without payment or other consideration of any kind, or permission or notification, to you or any third party. You also hereby grant each User of this Site a non-exclusive license to access your User Content through this Site, and to use, reproduce, distribute, prepare derivative works of, combine with other works, display, and perform your User Content as permitted through the functionality of this Site and under this Agreement.The above licenses granted by you in your User Content terminate within a commercially reasonable time after you remove or delete your User Content from this Site. You understand and agree, however, that Company may retain (but not distribute, display, or perform) server copies of your User Content that have been removed or deleted. The above licenses granted by you in your User Content are perpetual and irrevocable.Company generally does not pre-screen User Content but reserves the right (but undertakes no duty) to do so and decide whether any item of User Content is appropriate and/or complies with this Agreement. Company may remove any item of User Content if it violating this Agreement, at any time and without prior notice.

7. LINKS TO THIRD-PARTY WEBSITES

This Site may contain links to third-party websites that are not owned or controlled by Company. Company assumes no responsibility for the content, terms and conditions, privacy policies, or practices of any third-party websites. In addition, Company does not censor or edit the content of any third-party websites. By using this Site you expressly release Company from any and all liability arising from your use of any third-party website. Accordingly, Company encourages you to be aware when you leave this Site and to review the terms and conditions, privacy policies, and other governing documents of each other website that you may visit.

8. DISCLAIMER OF REPRESENTATIONS AND WARRANTIES

YOU SPECIFICALLY ACKNOWLEDGE AND AGREE THAT YOUR USE OF THIS SITE SHALL BE AT YOUR OWN RISK AND THAT THIS SITE ARE PROVIDED “AS IS”, “AS AVAILABLE” AND “WITH ALL FAULTS”. COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, AGENTS, DISCLAIM ALL WARRANTIES, STATUTORY, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, AND AGENTS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT (I) THE ACCURACY, COMPLETENESS, OR CONTENT OF THIS SITE, (II) THE ACCURACY, COMPLETENESS, OR CONTENT OF ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, AND/OR (III) THE SERVICES FOUND AT THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, AND COMPANY ASSUMES NO LIABILITY OR RESPONSIBILITY FOR THE SAME.IN ADDITION, YOU SPECIFICALLY ACKNOWLEDGE AND AGREE THAT NO ORAL OR WRITTEN INFORMATION OR ADVICE PROVIDED BY COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, OR AGENTS, AND THIRD-PARTY SERVICE PROVIDERS WILL (I) CONSTITUTE LEGAL OR FINANCIAL ADVICE OR (II) CREATE A WARRANTY OF ANY KIND WITH RESPECT TO THIS SITE OR THE SERVICES FOUND AT THIS SITE, AND USERS SHOULD NOT RELY ON ANY SUCH INFORMATION OR ADVICE.THE FOREGOING DISCLAIMER OF REPRESENTATIONS AND WARRANTIES SHALL APPLY TO THE FULLEST EXTENT PERMITTED BY LAW, and shall survive any termination or expiration of this Agreement or your use of this Site or the Services found at this Site.

9. LIMITATION OF LIABILITY

IN NO EVENT SHALL COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, AGENTS, AND ALL THIRD PARTY SERVICE PROVIDERS, BE LIABLE TO YOU OR ANY OTHER PERSON OR ENTITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING ANY DAMAGES THAT MAY RESULT FROM (I) THE ACCURACY, COMPLETENESS, OR CONTENT OF THIS SITE, (II) THE ACCURACY, COMPLETENESS, OR CONTENT OF ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, (III) THE SERVICES FOUND AT THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, (IV) PERSONAL INJURY OR PROPERTY DAMAGE OF ANY NATURE WHATSOEVER, (V) THIRD-PARTY CONDUCT OF ANY NATURE WHATSOEVER, (VI) ANY INTERRUPTION OR CESSATION OF SERVICES TO OR FROM THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, (VII) ANY VIRUSES, WORMS, BUGS, TROJAN HORSES, OR THE LIKE, WHICH MAY BE TRANSMITTED TO OR FROM THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, (VIII) ANY USER CONTENT OR CONTENT THAT IS DEFAMATORY, HARASSING, ABUSIVE, HARMFUL TO MINORS OR ANY PROTECTED CLASS, PORNOGRAPHIC, “X-RATED”, OBSCENE OR OTHERWISE OBJECTIONABLE, AND/OR (IX) ANY LOSS OR DAMAGE OF ANY KIND INCURRED AS A RESULT OF YOUR USE OF THIS SITE OR THE SERVICES FOUND AT THIS SITE, WHETHER BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL OR EQUITABLE THEORY, AND WHETHER OR NOT COMPANY IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.IN ADDITION, You SPECIFICALLY ACKNOWLEDGE AND agree that any cause of action arising out of or related to this Site or the Services found at this Site must be commenced within one (1) year after the cause of action accrues, otherwise such cause of action shall be permanently barred.THE FOREGOING LIMITATION OF LIABILITY SHALL APPLY TO THE FULLEST EXTENT PERMITTED BY LAW, AND shall survive any termination or expiration of this Agreement or your use of this Site or the Services found at this Site.

10. INDEMNITY

You agree to protect, defend, indemnify and hold harmless Company and its officers, directors, employees, agents from and against any and all claims, demands, costs, expenses, losses, liabilities and damages of every kind and nature (including, without limitation, reasonable attorneys’ fees) imposed upon or incurred by Company directly or indirectly arising from (i) your use of and access to this Site; (ii) your violation of any provision of this Agreement or the policies or agreements which are incorporated herein; and/or (iii) your violation of any third-party right, including without limitation any intellectual property or other proprietary right. The indemnification obligations under this section shall survive any termination or expiration of this Agreement or your use of this Site or the Services found at this Site.

11. DATA TRANSFER

If you are visiting this Site from a country other than the country in which our servers are located, your communications with us may result in the transfer of information across international boundaries. By visiting this Site and communicating electronically with us, you consent to such transfers.

12. AVAILABILITY OF WEBSITE

Subject to the terms and conditions of this Agreement and our policies, we shall use commercially reasonable efforts to attempt to provide this Site on 24/7 basis. You acknowledge and agree that from time to time this Site may be inaccessible for any reason including, but not limited to, periodic maintenance, repairs or replacements that we undertake from time to time, or other causes beyond our control including, but not limited to, interruption or failure of telecommunication or digital transmission links or other failures.You acknowledge and agree that we have no control over the availability of this Site on a continuous or uninterrupted basis, and that we assume no liability to you or any other party with regard thereto.

13. DISCONTINUED SERVICES

Company reserves the right to cease offering or providing any of the Services at any time, for any or no reason, and without prior notice. Although Company makes great effort to maximize the lifespan of all its Services, there are times when a Service we offer will be discontinued. If that is the case, that product or service will no longer be supported by Company. In such case, Company will either offer a comparable Service for you to migrate to or a refund. Company will not be liable to you or any third party for any modification, suspension, or discontinuance of any of the Services we may offer or facilitate access to.

14. FEES AND PAYMENTS

You acknowledge and agree that your payment will be charged and processed by swapnil.pw.You agree to pay any and all prices and fees due for Services purchased or obtained at this Site at the time you order the Services.Company expressly reserves the right to change or modify its prices and fees at any time, and such changes or modifications shall be posted online at this Site and effective immediately without need for further notice to you.Refund Policy: for products and services eligible for a refund, you may request a refund under the terms and conditions of our Refund Policy which can be accessed here.

15. NO THIRD-PARTY BENEFICIARIES

Nothing in this Agreement shall be deemed to confer any third-party rights or benefits.

16. COMPLIANCE WITH LOCAL LAWS

Company makes no representation or warranty that the content available on this Site are appropriate in every country or jurisdiction, and access to this Site from countries or jurisdictions where its content is illegal is prohibited. Users who choose to access this Site are responsible for compliance with all local laws, rules and regulations.

17. GOVERNING LAW

This Agreement and any dispute or claim arising out of or in connection with it or its subject matter or formation shall be governed by and construed in accordance with the laws of India, Telangana, to the exclusion of conflict of law rules.

18. DISPUTE RESOLUTION

Any controversy or claim arising out of or relating to these Terms of Services will be settled by binding arbitration. Any such controversy or claim must be arbitrated on an individual basis, and must not be consolidated in any arbitration with any claim or controversy of any other party. The arbitration must be conducted in India, Telangana, and judgment on the arbitration award may be entered into any court having jurisdiction thereof.

19. TITLES AND HEADINGS

The titles and headings of this Agreement are for convenience and ease of reference only and shall not be utilized in any way to construe or interpret the agreement of the parties as otherwise set forth herein.

20. SEVERABILITY

Each covenant and agreement in this Agreement shall be construed for all purposes to be a separate and independent covenant or agreement. If a court of competent jurisdiction holds any provision (or portion of a provision) of this Agreement to be illegal, invalid, or otherwise unenforceable, the remaining provisions (or portions of provisions) of this Agreement shall not be affected thereby and shall be found to be valid and enforceable to the fullest extent permitted by law.

21. CONTACT INFORMATION

If you have any questions about this Agreement, please contact us by email or regular mail at the following address:swapnil.pw

Hyderabad

India

callswapnil@gmail.com

What is machine learning

Hello again. Welcome to my blog, this is my third post. I will talk about different applications of Machine Learning as well as share code and applications in future posts. But before that, I would like to talk about basics so those you are looking to understand the concepts would find it very useful. In this post, we will see what is machine learning.

Machine learning is a method of data analysis that automates analytical model building. It is a branch of artificial intelligence based on the idea that systems can learn from data, identify patterns and make decisions with minimal human intervention.

Machine learning, at its most basic, is the method of training a computer system to make correct estimates when given data. Those forecasts could include determining whether a piece of fruit in a photograph is a banana or an apple, detecting people crossing a road in front of a self-driving car, determining whether the use of the term book in a statement refers to a printed book or a hotel reservation, determining whether an email is spam, or accurately recognizing speech to start generating subtitles for a Youtube clip.

The main difference between this and conventional computer software is that a human creator did not write the code that tells the scheme how to discern the difference between a banana and an apple. Instead, a machine-learning model has been trained to reliably distinguish between the fruits by being educated on a large amount of data, most likely a huge number of images labeled as comprising a piece of fruit.


Why Do We Need It?

As the name implies, machine learning is an active process in which computers learn and analyses data fed to them in order to determine the future. There are various types of learning, such as supervised, unmonitored, semi-supervised, and so on. Machine learning is a stepping stone to artificial intelligence; it learns from algorithms based on databases and originates answers and comparisons from them. Equipment and digital conversion are inextricably linked, and machine learning is at the heart of both.
Google announced its graph-based machine learning tool in 2016. It connected data clusters based on the similarities using the semi-supervised active learning. Machine learning algorithms assists industries in identifying market dynamics, possible risks, customer requirements, and business insights. Today, business analytics and mechanization are the norms, and machine learning is the foundation for achieving these goals and increasing your operational productivity.


How Machine Learning Works?
Machine Learning is without a hesitation one of the most intriguing subsets of Artificial Intelligence. It performs the tasks of data studying by providing specific inputs to the machine. It is critical to recognize how Machine Learning works and, as a result, how it could be used in the long term.
The Machine Learning process begins with the input of training data into the chosen algorithm. To see if the machine learning model is working properly, incoming data information is passed into it. The forecasting and the results are then cross-checked. If the prediction and results do not match, the methodology is re-trained several times until the data scientist obtains the desired outcome.  


Why is Machine Learning Important?
Recognize the ego Google car, cyber fraud prevention, and online suggestion engines from Facebook, Netflix, and Amazon to gain a better understanding of Machine Learning’s applications. All of these things can be enabled by machines by filtering valuable information and cobbling it all together premised on the patterns to produce reliable data.


Different Types of Machine Learning
 

Supervised Learning:
The machine learning model in supervised learning is recognized or labeled data. Because the data is known, the knowledge is monitored, i.e. directed toward successful implementation. The input data is processed by the Machine Learning algorithm, which is then used to train the model.
Once the model has been trained on existing data, you can feed unknown data into it to get a reasonable response. In this particular instance, the model attempts to determine whether the data is an apple or another type of fruit. Again when the model has been properly trained, it will recognize the data as an apple and respond accordingly.


Unsupervised Learning:
The training set in unsupervised classification is unidentified and unidentified, implying that no one has previously examined the data. The contribution cannot be steered to the automated system without the component of known data, which is where the term “unsupervised” comes from.
This information is fed into the Machine Learning algorithm, which is then used to train a model. The model attempts to find a pattern and provide the expected reaction. In this case, it frequently appears that the algorithm is attempting to break code in the same way that the Enigma machine did, but without the human brain involved directly, but rather a machine. In this case, the unknown data consists of apples and pears that resemble one another. The trained model attempts to group them all so that you get the same things in similar organizations.


Reinforcement Learning:
In this case, the algorithm, like in conventional kinds of data assessment, uncovers data through trial and error and then makes the decision which action leads to higher rewards. Learning algorithm is made up of three major elements: the agent, the surroundings, and the behavior.
The student or judgment is the agent, the environment encompasses everything with which the agent comes into contact, and the activities are what the representative does. Reinforcement learners learn when the agent selects actions that maximize the immediate value over a specified time period. This is simplest to accomplish when the agent works within a solid policy structure.

Machine Learning types and different algorithms

I am leaving you with this picture, we will talk about these in coming posts.

For detailed discussion, you can refer my book on Machine Learning (using Python examples):
Buy on Amazon

(first appeared on Lambda and Sigma post – read here)