我只是想在熊猫中使用融化功能,我只是继续得到同样的错误.
只需键入文档提供的示例:
cheese = pd.DataFrame({'first' : ['John', 'Mary'],
'last' : ['Doe', 'Bo'],
'height' : [5.5, 6.0],
'weight' : [130, 150]})
Run Code Online (Sandbox Code Playgroud)
我刚收到错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-119-dc0a0b96cf46> in <module>()
----> 1 cheese.melt(id_vars=['first', 'last'])
C:\Anaconda2\lib\site-packages\pandas\core\generic.pyc in __getattr__(self, name)
2670 if name in self._info_axis:
2671 return self[name]
-> 2672 return object.__getattribute__(self, name)
2673
2674 def __setattr__(self, name, value):
AttributeError: 'DataFrame' object has no attribute 'melt'`
Run Code Online (Sandbox Code Playgroud) 我有一个从数组呈现的复选框列表 UI。更新阵列后,复选框列表状态不会更新。
我移动了映射列表的代码,但它不会改变结果。DOM 重新渲染不会发生,请参阅下面的 gif。
我一直在寻找周围,我看到这个问题已经被报告了,但是关于将list.map代码移出函数的解决方案对我不起作用。
你能给我建议一个解决方案吗?这个问题的根源是什么?
import React,{ useState } from "react"
import
{
Box,
DropButton,
Grid,
Text,
Calendar,
RangeInput,
CheckBox
} from "grommet"
const CalButton = ( { label,onSelect } ) =>
{
return (
<DropButton
label={ label }
dropAlign={ { top: 'bottom',left: 'left' } }
margin="small"
dropContent={
<Box pad="medium" background="ligth-3" elevation="small">
<Calendar range size="medium" onSelect={ onSelect } />
</Box>
} />
)
}
const RangeButton = ( { label,value,onChange,min,max,step,unit,header } ) =>
{
return ( …Run Code Online (Sandbox Code Playgroud)