熊猫,如何将列表传递到列表位置

时间:2020-08-31 02:06:11

标签: python pandas

mImageReader = ImageReader.newInstance(
        mScreenWidth,
        mScreenHeight,
        PixelFormat.RGBA_8888,
        2
    )

 getMediaProjectionManager().getMediaProjection(Activity.RESULT_OK, mResultData)

mVirtualDisplay = mMediaProjection!!.createVirtualDisplay(
        "screen-mirror",
        mScreenWidth, mScreenWidth,
        mScreenDensity,
        DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR, mImageReader?.surface,
        null,
        null
    )

我正在尝试将var image = mImageReader.acquireLatestImage() 传递到def data_cleaning(df, dict): df = df[df.columns[list(dict.values())] return df dict = { "cost": 0, "Price": 3 } 中 问题是,一旦接受列表,它就会变成dict,并带有一个括号

如何使功能按预期运行?

最好

1 个答案:

答案 0 :(得分:1)

选中.iloc

def data_cleaning(df, dict):
    df = df.iloc[:,list(dict.values())]
    return df