Hey dear what's up this is Kovid from
Coder Kovid so today we're going to head
over to data mining with Python so data
mining means to mine data from a file in
a Python program so I've made a sample
program for it so here I have made some
that as in CSV file and here you can see
subjects name roll number okay so this
is excel file so as I open this you can
see sorry you can see here and see it's
printed clearly so how will do this
these all data are taken from this one
as I change this one to something like
real and as I save and as I reload this
program it will display here something
like covered you can see here it's very
much simple guys this is called data
mining this is very much used in kind of
and data science with Python so let us
learn how we can do it first of all let
me close this make a file
sorry folder called like data data
science I will put like even good angle
so open it and here you can create a new
file with text document and change it to
data as dot DX not txt here CSV okay
guys so you can click on yes and now
it's changed to CSV file and here you
can create a new file called mine dot py
so we will just edit with ideally
so this is the whole program will be
going on so first of all we will lower
this file in this Python so python max
is very simple to load the file so I
will put a comment Lord let's open the
data dot CSV file in the program and I
will do denote a very vocal file so I'll
put it data ok output file equals and
the function is open that's the function
in Python to open a document so we'll
put a coat and here we'll put the same
name as of this
so it's data dot CSV and here you will
put a module are so how can you check it
the more you let me show you how you can
check it was just open like this whole
soil how you can check the more you so I
will look quint file
and as I okay so you can see here more
is our so this one will put in the
second context parameter as a second
parameter so now we have opened the file
okay guys now we will just take out the
lines of that file means data fit my
file so taking data out of the file that
is data not CSV
so do that to do that moving again
denote a variable called data equals and
here we have called file this one file
means that s dot CSV dot we will first
of all read that file ok read and its
function so we'll put two brackets and
again we will just split the lines okay
to read that line by line so it makes it
easy to write this kind of course and if
you are confused you can take that file
is it working or not so it's working
till now so we have ticked it let us so
just we will I'll put the data
outputting the data so here we will just
do a print output means we will print it
so we will print what so here now you
have to give a attention here role you
know the lines equals what we want is
first line F line will denote like f
line equals data 0 so I haven't taught
this one this data there 0 I will teach
you in the next lesson about this what's
this so just learn that this 0 means
first line 1 means second line 2 mins
third line okay so here should be square
bracket
okay so first line is the data's first
line okay so if we print like this F
line sorry F line and the output is not
why it's giving ever because here you
can see here is no any line so I will
just put like this Cove it could Cove it
YouTube channel so and then as i refresh
it it will give stay output because this
is very simple
okay guys and as we change the code here
means as we change the text year code
with Raj 20 and whole program will
change completely Jane's
so the it's the data signs are data
mining with Python so it's very much
interesting thing if you are thinking of
going to data science with title so here
I have how I did that this one I will
show you my previous project that was
data my so how I did it I will show the
code behind it you'll see I have just
defined a class so I will just cut it
it was just for fun I was just doing fun
with decor so I just so you can see how
I did it I just copied this means I have
just defined first line second line
second line third line for line fifth
line six lengths and more lines and I
have print rende like this and how I did
it in the line called covet that is
first line I will show you line by line
like this yeah in the line covet
this was the line I denoted that is one
we take the character from five so that
is 1 2 0 1 2 3 4 5 so from here we
started and ended up to 10 5 6 7 8 9 10
up to here and and this was printed as
name and again as roll number roll
number it was printed like same D line
but it was of kovat 11 so he was tame
laven and this one that's very simple
guys that was record behind the whole
program and the program looks like this
yeah and as I click enter the whole
program will exit so thank you guys for
watching this video this mods for today
we will learn more about Python and
programming in coming lessons but till
then keep smiling keep coding and I'll
meet you in the next one bye bye
