当我运行int hasOddCount(int x) {
int first = 0x11 | (0x11 << 8);
int second = first | (first << 16);
int mask = 0xf | (0xf << 8);
int count = 0;
int sum = second & x;
sum = (x>>1 & second) + sum;
sum = (x>>2 & second) + sum;
sum = (x>>3 & second) + sum;
sum = sum + (sum >> 16);
sum = ((sum & mask) + (mask & (sum >> 4)));
count = (((sum >> 8) + sum) & 0x3f);
//count is the Hamming weight, & by 0x1 to see if it's odd
return count & 0x1;
}
时,它会输出格式为YYYY-MM-DD,这就是我想在图中看到的格式。相反,在每个主要刻度线处,值例如是1.48 1e18,1.50 1e18等。是否有一种简单的方法可以转换为上述格式?
df.index
使用Python 3.6.2和pandas 0.21.0