TimeInfoBase#
- class astropy.time.TimeInfoBase(bound=False)[源代码]#
基类:
MixinInfo
用于存储诸如名称、描述、格式等元信息的容器。当对象用作表中的mixin列时,这是必需的,但也可以作为存储元信息的通用方法。
此基类在TimeInfo和TimeDeltaInfo之间是通用的。
属性摘要
方法总结
__call__
([option, out])将有关数据对象的摘要信息写入
out
文件句柄。adjust_indices
(index, value, col_len)修改列后调整信息索引。
返回一个数组列表,这些数组可以按字典排序以表示父列的顺序。
info_summary_attributes
\(日期)info_summary_stats
\(日期)iter_str_vals
\()这是mixin安全版本结构柱.
merge_cols_attributes
(cols, ...)合并和验证属性的实用方法
attrs
对于输入表列cols
.new_like
(cols, length[, metadata_conflicts, ...])返回与输入时间对象一致的新时间实例
cols
并且有length
排。slice_indices
(col_slice, item, col_len)给定一个切片对象,修改其索引以正确表示切片。
属性文档
- attr_names = {'description', 'dtype', 'format', 'indices', 'meta', 'name', 'parent_table', 'serialize_method', 'unit'}#
- attrs_from_parent = {}#
- description#
- dtype#
- format#
- groups#
- indices#
- mask_val = masked#
- meta#
- name#
- parent_table#
- serialize_method#
- unit#
方法文件
- __call__(option='attributes', out='')#
将有关数据对象的摘要信息写入
out
文件句柄。默认情况下,它通过系统标准输出.这个
option
参数指定要包含的信息类型。它可以是字符串、函数或字符串或函数的列表。内置选项包括:attributes
: data object attributes likedtype
andformat
stats
:基本统计:最小值、平均值和最大值
如果指定了一个函数,则将使用数据对象作为其单个参数来调用该函数。函数必须返回包含信息属性的OrderedDict。
如果提供了列表,那么将依次为每个选项附加信息属性。
- 参数:
- option :
str
,callable()
,list
的 (str
或callable()
)PYTHON:STR,PYTHON:Callable(),PYTHON:LIST OF(PYTHON:STR或PYTHON:Callable()) 信息选项,默认为“属性”。
- out : file-like object ,
None
PYTHON:类似文件的对象,PYTHON:无 输出目的地,默认为系统标准输出. 如果没有,则返回带信息属性的OrderedDict
- option :
- 返回:
- info :
OrderedDict
orNone
OrderedDict或Python:无 OrderedDict
如果输出==无其他无
- info :
实例
>>> from astropy.table import Column >>> c = Column([1, 2], unit='m', dtype='int32') >>> c.info() dtype = int32 unit = m class = Column n_bad = 0 length = 2
>>> c.info(['attributes', 'stats']) dtype = int32 unit = m class = Column mean = 1.5 std = 0.5 min = 1 max = 2 n_bad = 0 length = 2
- adjust_indices(index, value, col_len)#
修改列后调整信息索引。
- static info_summary_attributes(dat)#
- static info_summary_stats(dat)#
- iter_str_vals()#
这是mixin安全版本结构柱.
- static merge_cols_attributes(cols, metadata_conflicts, name, attrs)#
合并和验证属性的实用方法
attrs
对于输入表列cols
.注意
dtype
和shape
属性是专门处理的。这些不应该被传进去attrs
但将始终在合并属性的返回dict中。