本文整理匯總了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