`pandas.concat()`的第二个参数是什么?

huangapple go评论182阅读模式
英文:

pandas.concat() second argument?

问题

I freshly installed a program through pip3 and it now fails like this:

pandas.concat(dataFrameList, 0)
TypeError: concat() takes 1 positional argument, but 2 were given

I looked at the concat() function prototype in Pandas 0.9, 1.x and 2.x documentation but it appears that this second argument was never allowed; it works with Pandas 1.5 though...

What is the 0 supposed to do? Is it safe to remove it from the code?

英文:

I freshly installed a program through pip3 and it now fails like this:

pandas.concat(dataFrameList, 0)
TypeError: concat() takes 1 positional argument, but 2 were given

I looked at the concat() function prototype in Pandas 0.9, 1.x and 2.x documentation but it appears that this second argument was never allowed; it works with Pandas 1.5 though...

What is the 0 supposed to do? Is it safe to remove it from the code?

答案1

得分: 2

"我认为这是对axis参数的缩写:

pandas.concat(dataFrameList, axis=0)

这是默认参数,因此可以移除:

pandas.concat(dataFrameList)"
英文:

I think it is shorcut to axis parameter:

pandas.concat(dataFrameList, axis=0)

what is default parameter, so should be removed:

pandas.concat(dataFrameList)

huangapple
  • 本文由 发表于 2023年4月17日 19:42:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76034809.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定