In this session, we would begin with the dolphins and find those.
So they do things on the very basic data structure which are used in case of.
These are two dimensional labelled data structures with columns of potentially different shapes.
So we can have a growing column structure, but just kind of a double structure to work with.
Now, you can think of it like a spreadsheet or a school table or a normal Excel spreadsheet.
Usually what we work with our papers from databases or we work with Excel files or CSC files.
Now, these are all created from a dictionary or tabular data, so we will learn how we can work with
these data structures and how we can create a definition.
So let us first begin by creation of our data feme.
Now, before starting with the first thing which we will have to do is we will have to import the Fondas
library and the library so we will have thesea.
Import.
No, I as a. an import.
Fondas, Aspy.
Now, the next step would be to start creating different datasets now to create a dataset, let us create
certain attributes which we will be looking for or different features which we will be looking for.
OK, so let us create a feature.
See Idee.
And let this IDB and the run random.
North London and I want this idea to range from.
So let us create these IDs in a random manner and let's keep those values to be low from 20 and high
value to visit 2000 and let us be 20 such values.
So I give size equal to.
RCMP say 20.
So let me explain it for you.
So we give size equal to.
20.
So here we have random ideas which have been created.
Now, the next thing which we want is.
Let us see the age of a person, so let us bridge each column and it should be in the dot random.
Dorte.
Run in leathered range from as low as 15, high to be, let's say.
Sixty three.
And size should again be 20.
We are giving the citizens 20 because we want 20 rolls of data.
So we have created each.
Now, next thing what we can look for is now one more thing to take care of is that when we are done
reading these ideas, these ideas of the dawn want them to be randomly generated, or we might keep
them random or we can simply create them in a different way.
It is completely your choice if you want to put place equal to Broadfoot.
The next thing, let us create a column, see Sydney and in Sydney, we can put in the dot random dot
choice.
And the choice should be taken from these cities, say New York.
And I want.
Darlene.
And I want to see.
Iris and I won.
OK, and I won 20 such occurrences of this again.
So I give city, so we have these cities present now, the next thing what we can do is we can have
if someone's a loan has been approved or not.
So we can see approval.
And we can give in or random choice, and in this we can give.
Zero and one, and you will get 20 such values, so here we have approval.
Similarly, we can have as many problems, we can create as many problems as we want, so I just keep
it to dispatch only.
And from this now there are different ways how we can convert data to data from the first way, which
I would tell you is converting this entire data into a list and then converting that list into a data
frame.
So what we can do is we can simply say or did the my data or we can say the list.
And in this, I want to have a list which has been generated from the zip of.
Age.
City.
Approval.
And I so I'm giving idee.
Age, city answer.
So I will simply.
Run this and get the biggest.
So this is my off list.
Now, each of these values have been combined and created into couples and these couples are put into
a list.
So this is what we get.
Now, the next thing which we will be doing is converting it into a data frame.
So to convert anything to a data frame, what we simply do is we give the name data frame and we'll
see DOT data then.
And then we give the data, so the data is my D.F. list, so I will give data is equal to the list and
I have to give the column names, because if I will not provide the column names, then what will happen
is it will by default, consider the indexes to be the column names.
And I don't want to work with the indexes because it will be really difficult to work with the indexes.
And I will get to know that which index belongs to which columns.
And when we are working with huge data set at that time, we can get confused and we can do something
which is not actually the necessity or not required and we can just mess it up.
So what we will be doing is we will create column names so we can see columns.
And we will give the names, so let us give the column names like this will need these as my column
names.
I give this into a list from.
And these have to be springform.
Now, if I had done this and I will be able to view this data frame by typing vertically, so this is
the lead offering, which has been creative, I can view eatin' and you can see the indexes from zero
to 90 and the following names that I'd need to be in approval.
And what I can do is I can view different data points.
We can view different columns also by simply saying see the if not age.
So this gives me the data from the Age column, I can do something like the thought ID, so I was able
to see the values from the ID column.
Now, this is possible only if we don't have any spaces in my column names in case I have any spaces
in my column names, then this would not be possible.
So what I can do is.
Here, if I have something like Idi, Idi, something like this, then what we happen is now I try to
retrieve these IDs as IDs face ID.
Now, this would throw an error because it doesn't really know what this IDs.
So it is always suggested to either replace any spaces present in the column names by underscore or
just don't have any other source in the column names.
Now, if you want to access these values instead of using this, we can also use this index.
So in this way I can view the ID column into another thing.
What I can do is I can say the dot head and it will show me the top five rows of the data.
I can also define the number of values which I want, but by default it will give five.
If I want to view mine, then it will give me nine rows of data.
So it is completely up to me what all values I want to see.
If I want to view the deal, then I can say the dot the and again, it will show the bottom five to
me.
Now, the next thing what I can do is.
I can create a data frame using a dictionary format, so let us be downloaded of via and likely this
will override the previous.
So it's a fresh data from which I will be creating.
So it's not a data frame.
Please make sure that the F is capital in this.
And then we give the wrong reasons and then we create the dictionary and in the dictionary we will simply
give the column name, which we want to have.
So I give it.
Along with it, I will give the of the data which I have, so I give you, then I'll give each.
And each.
Then we have.
Approver.
And approval, and we also have to be so we give Cindy.
And Sydney.
So like this, we can think of another data name, and this is data from the 10th.
So we have created this definition.
Now, one thing you can notice here is that the sequence has also changed once I change the sequence
in the dictionary.
So this is one thing to take care of.
The next thing is, let us see, I want to access a particular value so we have access.
So we can access values, so let us say I want to access it again so I can say the and then I can definitely
see it here.
Or I can use a door that is completely up to me so I can do it this way now.
What I can do is I can see the.
Age.
Greater than C..
30.
So it will give me out the data, but when people have age greater than 30 or say greater than 50,
you want greater than 50.
So we get the data when people have age greater than 50.
Now, another thing, what we can do is we can access the data from files also so we can use read CSFI
for that.
So we will simply read the part of the fighting, so for you to define is equal to the fighting name
or by name in case it is in the same folder.
So I have bang.
Full.
Dart County.
So I have this file and I want to read this file into a data frame, so I will say data frame is equal
to read orders for CSP and this has to be a battle field.
So if we don't read CSFI and I give the file for you, so I will get the data frame and you can review
the data frame again by using the updated.
So this is the entire state of Maine now, please see that all this detail, which I have provided,
has come in a single column.
Here, this is the view which we get when we have the volume separator, but here all the details coming
into simply single volume.
So what we can do is we have to provide the limit, though, so we'll see.
Is equal to.
Semicolon.
So now it is separated all the data in two different columns now.
How we access these data and how we modify these data is something which we will know on in the next
session, so we will learn how we will convert these columns into numeric form, which we have already
taken a load off in the session, which we have discussed.
So let us see how we can modify this done, how we can work with the state.