Как сделать чистый временной ряд из набора данных, который насчитывает около 200 стран? - PullRequest
0 голосов
/ 05 августа 2020

Это набор данных, с которым я работаю (текстовая версия ниже): enter image description here

I am trying to make a time series plot that shows a country's performance over time. I used pandas to add new columns, for home points or away points, for each match. I then see each country's total points per year to measure performance over time and make a time series plot from the points per year. However, the issue is the dataset has matches for around 200 countries since 1872. As a result, my time series looks like this: введите описание изображения здесь

Я пробовал использовать df.resample и передискретизировать фрейм данных, чтобы показать 10-летние периоды, но это не работает, и временной ряд выглядит загроможденным. Есть ли у кого-нибудь рекомендации, как я могу очистить этот временной ряд, чтобы показать динамику страны в динамике?

Текстовая версия данных:

date    home_team   away_team   home_score  away_score  tournament  city    country neutral total_goals points_home points_away
0   1872-11-30  Scotland    England 0   0   Friendly    Glasgow Scotland    False   0   1.0 1.0
1   1873-03-08  England Scotland    4   2   Friendly    London  England False   6   3.0 0.0
2   1874-03-07  Scotland    England 2   1   Friendly    Glasgow Scotland    False   3   3.0 0.0
3   1875-03-06  England Scotland    2   2   Friendly    London  England False   4   1.0 1.0
4   1876-03-04  Scotland    England 3   0   Friendly    Glasgow Scotland    False   3   3.0 0.0
5   1876-03-25  Scotland    Wales   4   0   Friendly    Glasgow Scotland    False   4   3.0 0.0
6   1877-03-03  England Scotland    1   3   Friendly    London  England False   4   0.0 3.0
...