Professional Documents
Culture Documents
ML - Lab - 1 J2
ML - Lab - 1 J2
ML - Lab - 1 J2
1. The probability that it is Friday and that a student is absent is 3%. Since there are 5 school days
in a week, the probability that it is Friday is 20%. What is the probability that a student is absent
given that today is Friday? Apply Baye’s rule in python to get the result.
Program:
Output:
Theory:
22
2. Extract data from database using python.
Program:
Connecting with mysql :
Creating Database
Display Databases
Output:
Creating Tables:
Inserting data :
SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL
database engine. SQLite is the most used database engine in the world. SQLite is built into all mobile phones and
most computers and comes bundled inside countless other applications that people use every day
Kaggle is the world's largest data science community with powerful tools and resources to help you achieve your
data science goals.
Pandas?
Pandas is a Python library used for working with data sets.