ValueError:在Python Pandas中使用序列设置数组元素

问题描述

错误消息:

let dw_result: DWORD;
let mut h_enum: LPHANDLE = null_mut();
let mut lpnr_local: LPNETRESOURCEW = null_mut();


dw_result = WNetopenEnumW(RESOURCE_GLOBALNET,// all network resources
                          RESOURCETYPE_ANY,// all resources
                          0,// enumerate all resources
                          lpnr_local,// NULL first time the function is called
                          h_enum);
if dw_result != WN_NO_ERROR {
     println!("WnetopenEnum Failed with error {:?}\n",dw_result);
}

代码

public void DrawImage(int image)
        {
            GL.MatrixMode(MatrixMode.Projection);
            GL.Pushmatrix();
            GL.LoadIdentity();

            GL.Ortho(0,3840,2160,-1,1);

            GL.MatrixMode(MatrixMode.Modelview);
            GL.Pushmatrix();
            GL.LoadIdentity();

            GL.disable(EnableCap.Lighting);

            GL.Enable(EnableCap.Texture2D);

            //GL.Color4(1,1);

            GL.BindTexture(TextureTarget.Texture2D,image);

            GL.Begin(BeginMode.Quads);

            GL.TexCoord2(0,0);
            GL.Vertex3(0,0);

            GL.TexCoord2(1,0);
            GL.Vertex3(2160,1);
            GL.Vertex3(2160,0);

            GL.TexCoord2(0,1);
            GL.Vertex3(0,0);

            GL.End();

            GL.disable(EnableCap.Texture2D);
            GL.PopMatrix();

            GL.MatrixMode(MatrixMode.Projection);
            GL.PopMatrix();

            GL.MatrixMode(MatrixMode.Modelview);
        }

错误行

Traceback (most recent call last):
  File "code.py",line 375,in write_func
    data_df['category'].iloc[0] = list
  File "lib/python3.7/site-packages/pandas/core/indexing.py",line 670,in __setitem__
    iloc._setitem_with_indexer(indexer,value)
  File "lib/python3.7/site-packages/pandas/core/indexing.py",line 1802,in _setitem_with_indexer
    self.obj._mgr = self.obj._mgr.setitem(indexer=indexer,value=value)
  File "lib/python3.7/site-packages/pandas/core/internals/managers.py",line 534,in setitem
    return self.apply("setitem",indexer=indexer,line 406,in apply
    applied = getattr(b,f)(**kwargs)
  File "lib/python3.7/site-packages/pandas/core/internals/blocks.py",line 881,in setitem
    values = values.astype(arr_value.dtype,copy=False)
ValueError: setting an array element with a sequence

我不确定这里出了什么问题。任何帮助将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)