小编Cza*_*ang的帖子

如何在if语句中将一个值与“ NaN”进行比较:Python 3.5.2 | Anaconda 4.1.0(64位)例如:a!= Nan其中a是浮点值

for r in range(65000):
    for c in range(8):
        if df1.iloc[r,c] != NaN:
            k=k+1
            df.iloc[k,3] = df1.iloc[r,c]
        else:
            print("Nan Detected")
            l=l+1
print(l," Nan Values encountered")
Run Code Online (Sandbox Code Playgroud)

python-3.x anaconda

0
推荐指数
1
解决办法
6532
查看次数

如何将熊猫数据帧的两列相乘(行乘法)并将结果存储在新列中?

命令

df_main['Ranking'] = df_main['Porosity']*['Permeability'] 给 -

类型错误:不能将序列乘以“str”类型的非整数

attacehd 图片(https://i.stack.imgur.com/0Asu3.png)有更多信息。我的代码片段位于 i.stack.imgur.com/ehqF5.png)

更多信息:https : //i.stack.imgur.com/0Asu3.png

python python-3.x pandas

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

python-3.x ×2

anaconda ×1

pandas ×1

python ×1