Helen, before going deep dive into the session, let's have a walkthrough on what we all have done
in all our previous session.
So from importing the data to the data, cleaning from data preprocessing, we have to deal with all
these features.
We have to deal with data.
Jurnee, arrival time, departure time, as well as we have also deal with our duration column as well.
So in this session, we have to fudge.
Yeah.
What can with our what can we do Mynott for this particular duration.
So we have to fetch this particular data and we have to insert as a separate feature in our data frame.
So what if let's say if I'm going to copy it, let me show you a thing and if I'm going to paste over
there and let's say if I'm going to call, I split or there on the basis of space, if you have to split
it.
So it would exactly return a list of our and this may not let's say I have to add to this hour so you
guys can access this hour, bypassing index of your list to just pazira an index and you guys will see
you have access to our and if you want to access your two, because two is exactly.
You are over here.
So in such case, what you have to do, you have to say here, you have to say I have to access from
zero to minus one.
So if I'm going to execute it, you will see over here, here you have two as our that's what you exactly
need.
Similarly, if you need your mynor.
So in such case, you guys can pass over here one.
So here you will get to safety.
That's what I'm trying to show you.
So what I'm going to do now, I'm going to define a function like, say, hour and whatever X or whatever
duration I'm going to pass it to function.
It will exactly an hour on that particular duration.
So to access your hour, I'm just going to copy this.
And here I have to just pass zero.
So what I'm going to do on X, I'm going to say just call is split and here you have to parse zero to
an the hour and basically you have to return all this stuff to access your other similarly to access
your minute.
I'm just going to copy it and just going to paste over here.
And this time I have to do some modifications in my function.
So here my function name is nothing but my Mynatt and this time I'm going to say two acts as many of
you have to password have one and you have to simply return it.
I'm just going to execute it and now you have to apply this function on your duration column.
So now I'm going to say krein underscore data of duration don't apply.
To apply a function you have to use this apply.
And what I have to apply, I have to apply this hour.
Similarly, I'm just going to copy it and I'm just going to paste over here.
This time I have to apply my function and whatever hour it is I have to store it somewhere else.
That's it.
I have to store it in a new feature.
So I have to define that feature length in my feature name is nothing but duration underscore hours.
Similarly, this time my feature name is nothing but duration underscore like say Maynards and what
I have to do, I have to just execute it.
Now we will see all the stuff gets executed over.
And now this time if I'm going to call ahead or whatever you will see are two new column has been added
in your data frame, which is nothing.
But my duration is call hours and duration and it's now what we have to do.
We have to simply drop this duration to four days.
What we guys can do, you guys can use our defined function name that we have defined earlier.
And here, if you will, press shift plus tab, you will get all the parameters that I have defined.
The very first one.
What exactly is a frame and the second one, what is exactly column name.
So I have to say, all these things just executed and this column gets removed from your data frame.
And if I'm going to check what exactly is a data type right now of each and every feature, you will
see a duration of hours and duration.
Myners is of Objet, but theno it is somehow of nomadic format.
It means you have to deal with that.
It means you have to convert that data type of this duration is four hours as well as duration to four
minutes.
So four days.
What I'm going to do very first, I have to constrain it and here I am going to access my duration for
hours on this.
I'm going to call my Istat function.
And here I have to mention I'm going to change it into my into the format.
So now I have to ask.
This my generation.
School, I was assured, because I have to update it as well, so after doing all this stuff, I have
to also perform it for my ghoulishness coalminer's.
And on days, what I am going to do, I have to simply call my stip over there and here.
I have to update this entire column as well.
So I'm just going to pasted after it.
I have to just execute it now.
The Celgar successfully executed and if I'm with crosschecked basically to just start to get your data
set estimation and accurate, if I'm I would call daps.
You will see this Bota column get converted into some Intisar form.
And that's what I'm trying to show you.
Let's say from this training data, which is exactly my data frame, let's say you have to extract.
Yeah.
What are my categorical data and what are my numerical data or what are my continuous features?
So what I am going to do very first, I'm going to trade on this data frame.
I'm going to trade on each and every column in one frame and whosoever has a data type object, I'm
going to consider that column as a categorical data.
So for this, I have to say for column in this country and data column.
So this is basically my creation.
And here I have to put up a nation if train data column dot data, it goes to object.
So if this condition is going to satisfy, then only I'm going to consider that column in my list.
So this is exactly a code of list comprehension in Biton.
So let's say I'm going to Stormi all the columns now in my Katinas list and if you have to bring this,
you guys can simply printed, you will see it has all these column name that supports categorical data.
Let's say you have to fetch your what are my continuous features in such case.
You guys can say wherever this condition will not satisfy.
So those all the features are exactly my continuous column.
Similarly, you can print it as well to just execute it.
And these are all my continuous features of my data that we all have to play with that in all of our
upcoming sessions.
So in the upcoming session, we are basically going to deal with this categorical data.
We are going to encode this data because these are exactly my categorical data and machine learning.
Just understand my Intisar data.
It means you have to convert this categorical data into some Intisar format, into some flawed format,
because machine learning only works on Intisar data.
That's why you have to do all these modifications, all these feature encoding on your data.
So hope you love the session very much.
And this session will be definitely very helpful for you.
Thank you.
Have a nice day.
Keep learning.
Keep growing.
Keep practicing.