本文整理汇总了Python中atpy.Table.remove_columns方法的典型用法代码示例。如果您正苦于以下问题:Python Table.remove_columns方法的具体用法?Python Table.remove_columns怎么用?Python Table.remove_columns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atpy.Table
的用法示例。
在下文中一共展示了Table.remove_columns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Table
# 需要导入模块: from atpy import Table [as 别名]
# 或者: from atpy.Table import remove_columns [as 别名]
#program that reads in results from Matt's SED fitter and
# then creates a unfied dust mass cloumn
import numpy as np
from os.path import join as pj
from atpy import Table
import matplotlib.pyplot as plt
import pylab as pl
cat = Table("/Users/chrisfuller/Dropbox/phd/herchel/coma/sed-fits/sed-all.fits")
bands = ["F500","F350","F250","F160","F100"]
""" Create detected column """
cat.remove_columns(['DETECTED'])
""" Loop through cat bands and add number to detected col """
for i in range(len(bands)):
band = bands[i]
cat.add_column('D' + band[-3:], [0]*len(cat))
flux = np.nan_to_num(cat[band])
w = np.where(flux != 0.0)[0]
cat['D' + band[-3:]][w] = 1
total = cat.D500 + cat.D350 + cat.D250 + cat.D160 + cat.D100