Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用loc,尤其是关于参数_Python_Null_Operators - Fatal编程技术网

Python 使用loc,尤其是关于参数

Python 使用loc,尤其是关于参数,python,null,operators,Python,Null,Operators,我的英语可能不太好,如果在某种程度上打扰了你,我道歉。 这些数据是关于产品销售的。主要包括26项中的“项目名称”、“项目价格” flg_is_null = uriage_data["item_price"].isnull() 首先,检查“物料价格”列中是否有空值 在上面的代码中,“item_name”列中提取空值。然后,检查值以避免重复 price = uriage_data.loc[(~flg_is_null)&(uriage_data["item_n

我的英语可能不太好,如果在某种程度上打扰了你,我道歉。 这些数据是关于产品销售的。主要包括26项中的“项目名称”、“项目价格”

flg_is_null = uriage_data["item_price"].isnull()
首先,检查“物料价格”列中是否有空值

在上面的代码中,“item_name”列中提取空值。然后,检查值以避免重复

 price = uriage_data.loc[(~flg_is_null)&(uriage_data["item_name"] == trg),"item_price"].max()
在此代码中,“~flg_is_null”的值最初来自“item_price”列。 但是,loc属性参数的第一个顺序是一行,在一列之后。 我想知道为什么列的值是一阶的。这违反了loc的规定

 price = uriage_data.loc[(~flg_is_null)&(uriage_data["item_name"] == trg),"item_price"].max()