Welcome back.
As a quick recap of what we did before, we installed TensorFlow generated random numbers and set the
seeds.
Also, we created those variables size and price linked together by this equation.
Now we're going to convert numpy array into pandas dataframe in order to be plotted and in a table format.
Okay, so first of all let me introduce uh the and let's clarify some concepts we need to concatenate.
And in the previous videos we learned about concatenation.
And we did this step before okay I love writing uh the notes uh, like this because they are very useful
when going back to this.
Uh ipy.
And B file using TensorFlow file and the notebook, everything will be clarified.
So data equals to PD dot data frame and concatenate this size and price.
Set the axis equals to y and the columns named as size and the price in thousand dollars.
What we did here we are converting numpy array into pandas dataframe.
As you learned before, we generated random arrays here.
Size and price like this.
So before concatenation we have a size array and a price array.
The size array for example 1.372.771..
Did you remember the range from 1 to 3.
Also the price array.
Also we set the range.
And here we have the size and arrays without concatenation.
So think about them as two arrays with 100 rows and one column.
After concatenation, we get a combined array.
So the first element in the array size is combined with the first element of the price array.
We have this element.
The first one represents the size and the second one represents the price.
Okay.
This is a combined array 100 rows and two columns.
So you, uh, see the difference guys.
How?
Before concatenation we get two arrays 100 rows and one column, but two arrays here after concatenation
we have only one array containing two row two columns and 100 rows.
Okay.
So this is about the MP dot concatenate.
The axis equals to one means join side by side horizontally instead of stacking vertically.
So x is one means I need to set them as a horizontal manner side by side.
Then we created the columns.
So those columns will represent the size here and the price.
Okay so the first one is the size, the second one is the price.
And the title of the table would be.
And the title of the columns would be size and the price.
Exactly like in this format.
Okay.
Don't worry.
We're going to run this, um, this cell and see the results.
Let's run.
I got this error because I restarted my computer.
So let me start from the beginning, importing TensorFlow and generating the random data before running
this cell.
And here we go.
We have this generated data size.
They see the title of the first column and the price the title of the second column.
And we get the first ten results using data dot head.
If you want to get all the data, we use data directly.
And here we go.
We have 100 rows with two columns.
Okay guys this is how we set.
And uh, we, we control the generated data and how we display the them into a data frame.
Okay.
So here we converted numpy array into pandas data frame okay.
So this is our data.
Now we can work with it.