Apologies for the wording of the question but I can illustrate my problem more clearly below.
Suppose I have the following dataframe:
| Region | Value |
|---|---|
| London North | 8 |
| North Yorkshire | 4 |
| London South | 6 |
| South Yorkshire | 6 |
How can I combine the London rows and the Yorkshire rows and produce the mean of their values?
(This is a simplified example of the dataframe I am working with which consists of approx. 3000 rows.)
I would like to get the following dataframe:
| Wider Region | Avg. Value |
|---|---|
| London | 7 |
| Yorkshire | 5 |
没有评论:
发表评论