如何使用循环对多个天文表进行 vstack
我有一个Astropy表的列表,我想使用循环来vstack。
这就是我所拥有的:
tables = []
for i in range(len(sortedfiles)):
tables.append(openfits(sortedfiles[i]))
它创建一个列表,每个元素都是Astropy表。我总共有144个这样的表。
我想垂直堆叠它们,所以我实际上只有一个Astropy桌子,但是我想不出正确的循环。有什么想法吗? tia
I have a list of astropy tables and I want to vstack them all using a loop.
This is what I have:
tables = []
for i in range(len(sortedfiles)):
tables.append(openfits(sortedfiles[i]))
which creates a list where each element is an astropy table. I have a total of 144 such tables.
I want to vertically stack them so I have effectively just the one astropy table but I cannot think of the right kind of loop. Any ideas? TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你很近!剩下的就是:
您所做的工作是为了读取
table
列表的所有表,然后在末尾进行单个vstack
操作是正确的方法。请勿在循环中使用vstack
,因为这会慢。You are very close! All that is left is:
What you have done to read all the tables up front to a list of
Table
followed by a singlevstack
operation at the end is the right way. Do not usevstack
within the loop since this will be slower.