BUG: period resampling bug when all values fall into a single bin. close #2070