替换Python数据框中的空白空间

时间:2018-12-04 16:26:24

标签: python pandas numpy dataframe

我知道有很多关于此的帖子,我已经阅读了很多,但是我似乎无济于事

import React, { Fragment, Children, cloneElement } from 'react'

const annotateFirstChild = (children, props) => Children.map(children, (ch, i) => {
  if (i > 0) {
    return ch
  }
  return isHtmlElement(ch)
    ? cloneElement(ch, { ...props })
    : magicCollapse(annotateFirstChild(magicExpand(ch), props)) 
})


const PropsPassingFragment = ({ children, ...props }) => {
  return (
    <Fragment>
      {annotateFirstChild(children, props)}
    </Fragment>
  )
}

我基本上只是想用上面一行中的数据替换空单元格。我已经尝试过这行代码,但是它似乎并没有取代空单元格。这也是将运行数千次的过程的一部分-如果可能,我希望不必执行任务,除非有空行。

                            O         H         L         C   MLR_CQG
DateTime                                                             
2011-09-19 22:00:00   -0.3606   -0.3605   -0.3611   -0.3611 -0.361171
2011-09-19 23:00:00   -0.3611   -0.3611   -0.3614   -0.3614 -0.361202
2011-09-20 00:00:00   -0.3614   -0.3602   -0.3614   -0.3613 -0.361344
2011-09-20 01:00:00                                         -0.361571
2011-09-20 02:00:00   -0.3613   -0.3613   -0.3614   -0.3613 -0.361752
2011-09-20 03:00:00   -0.3613   -0.3601   -0.3613   -0.3607 -0.361806
2011-09-20 04:00:00   -0.3611   -0.3607   -0.3614   -0.3608 -0.361845
2011-09-20 05:00:00   -0.3607   -0.3596   -0.3614   -0.3596 -0.361806
2011-09-20 06:00:00   -0.3603   -0.3594   -0.3604   -0.3601 -0.361796
2011-09-20 07:00:00   -0.3601   -0.3595   -0.3601   -0.3597 -0.361725
2011-09-20 08:00:00   -0.3599   -0.3599   -0.3613   -0.3607 -0.361753
2011-09-20 09:00:00   -0.3609   -0.3603   -0.3641    -0.363 -0.362013
2011-09-20 10:00:00   -0.3631   -0.3617   -0.3636   -0.3634 -0.362320
2011-09-20 11:00:00   -0.3635    -0.363   -0.3647   -0.3643 -0.362667
2011-09-20 12:00:00   -0.3642   -0.3639   -0.3651   -0.3647 -0.362993
2011-09-20 13:00:00   -0.3644   -0.3644   -0.3654    -0.365 -0.363288
2011-09-20 14:00:00   -0.3651   -0.3636   -0.3652   -0.3645 -0.363558
2011-09-20 14:30:00   -0.3646   -0.3636   -0.3649   -0.3641 -0.363725
2011-09-20 15:30:00   -0.3637   -0.3627   -0.3644   -0.3643 -0.363879
2011-09-20 16:30:00   -0.3637   -0.3629   -0.3638   -0.3629 -0.363929
2011-09-20 18:00:00                                         -0.363892
2011-09-20 19:00:00   -0.3636   -0.3627   -0.3637   -0.3627 -0.363812

0 个答案:

没有答案