python - function() 缺少 4 个必需的位置参数
问题描述
问题显示在第 90 行。
我认为主要问题在于数据框。因此,在计算值之后,function
我返回了一个数据框。该函数在 for 循环中用于生成不同的行,如下所示。
代表性情节:我一直在尝试一些线索,但仍然无法正常工作
![在此处输入图像描述][1]
import math as m
import matplotlib.pyplot as plt
import pandas as pd
#tst=529
#temp=524
#dtube=0.41
def function(ConstantA,ConstantB,tst,temp,dtube):
# variables and constants
k0 = 38.9
e = 90000
lambd=-328200
dp=0.003;roecat= 1670; porosity=0.4; cpa=95.2; cpb=32; cpc= 102.81;cpc= 71; ma=28;mb=32;mc=44;md=16; viscosity=0.25e-4;tst=tst;
dtube=dtube;ntube=25000; ltube= 9.8288; dw=1;wplot=0; yar=0;ybr=0;np=0;pi=3.1416; areacstube= pi * (dtube ** 2) / 4; wmaxtube=ltube * areacstube * roecat;wmax=wmaxtube * ntube;
# Initial conditions
w=0; fc=0; fa0=0.8125; fb0=0.26;fd0=2.175;fr=0;temp=temp; p=17; fain=fr * yar+fa0; fbin=fr * ybr+fb0;fdin=fd0;
解决方案
您正在调用function(row)
,其中仅包含所需 5 的一个参数(即ConstantA,ConstantB,tst,temp,dtube
)。
如果您想解压缩行中的每个项目,以便对应每个参数,您可以这样做function(*row)
。
推荐阅读
- computer-science - 如何对 5 个正整数进行排序?
- amazon-web-services - AWS Educate 账户下的 AWS CodeDeploy
- php - 为什么MongoDB集合中Phalcon\Mvc\Collection的delete()方法可能不起作用?
- php - 对自己的服务器的 Guzzle 发布请求导致“404 Not Found”
- python - Python3:If 和 else 运行良好,但是当我添加 elif 时没有输出
- angular - Angular - curl API - 发送 2 个参数
- django - 在 django 2.x admin 中更改 VISIT SITE 的详细名称
- quarkus - 为什么配置键“quarkus.servlet.context-path”不起作用
- python - 使用 urllib.request 在 python 中加载图像
- heroku - Google Oauth 不接受 Heroku 应用 URL