martijnvermaat / calmap

Calendar heatmaps from Pandas time series data -- See https://github.com/MarvinT/calmap/ for the maintained version
https://pythonhosted.org/calmap
MIT License
211 stars 61 forks source link

Bug with the 'sum' aggregation. #27

Closed yygrechka closed 3 years ago

yygrechka commented 5 years ago

When I run the code on the doc page: import numpy as np; np.random.seed(sum(map(ord, 'calmap'))) import pandas as pd import calmap

all_days = pd.date_range('1/15/2014', periods=700, freq='D') days = np.random.choice(all_days, 500) events = pd.Series(np.random.randn(len(days)), index=days) calmap.yearplot(events, year=2015) I get the following result: screenshot1 Only when I change the aggregation to be mean, I get the expected result:

calmap.yearplot(events, year=2015,how=u'mean') screenshot from 2019-02-03 22-36-33

python version: 3.7.1 pandas version: 0.23.4 calmap version: 0.0.7 matplotlib version: 3.0.1

tomkwok commented 4 years ago

This is fixed with the addition of a dropzero argument with a default True value for calplot in calplot.

MarvinT commented 3 years ago

Hi, if this problem still exists and you'd like to create a PR to fix it please direct it to https://github.com/MarvinT/calmap/ That is the version that gets published to pypi and has received several updates to fix some existing issues.

martijnvermaat commented 3 years ago

Thank you for creating the issue. Unfortunately I don't have the time to maintain this project. As per @MarvinT 's comment, please see https://github.com/MarvinT/calmap/ instead.