How can i get the mean of a column and create another column with its results?
So im working with a dataframe that contains info about the price at which several houses were sold in Melbourne during a certain time period. 

It looks like this:

<img width="517" alt="5" src="https://user-images.githubusercontent.com/51389829/59308652-6de04080-8c56-11e9-88a2-6ac79ae9eaa5.png">

Now, here comes the tricky part. I have dropped all columns in my dataframe except for "Date" and "Price", and i have used the groupby function to group every row according its date.

I want to get the mean price (under the 'Price' column) of all the rows that have the same date value (under the 'Date' column). Then, i want to input those values in a new column (say, 'AvgPrice') so as to create a nice looking scatter plot with that new column and the dates.

So, in other words, i have many 'Date' values, with different 'Price' values, but i would like to get a single 'Date' value for each date in the dataframe, and every single 'Date' value has to have its own corresponding price (which will result from doing the mean).

I hope that was clear enough. I apologize beforehand for my english.

So far, i have tried this code:

df2['AvgP'] = df2.groupby('Date')['Price'].mean()
df2.head()

This is the result i get:

<img width="171" alt="graph" src="https://user-images.githubusercontent.com/51389829/59309123-9fa5d700-8c57-11e9-9b4d-a74ad0da9903.png">

The column is created, but there are only null values in it. Also, the dates dont seem to group correctly.

What am i doing wrong?

Any help will be greatly appreciated!