Tabular
✖
Tabular
更多信息和选项
- Tabular 亦称为数据框架、表格和结构化数据.
- Tabular 通常用于每列可被视为变量、每行可被视为测量值的数据. 通常,仅显示含有部分数据的窗口.
- 每列都有一个元素类型,例如数字、字符串、日期或表达式. 允许出现数据丢失.
- data 可能的形式包括:
-
{row1,row2,…} 行列表组成的矩阵 » {assoc1,assoc2,…} 具有共同键的关联列表 » SparseArray[…],QuantityArray[…],… 特殊矩阵表示 » Dataset[…] 矩形数据集 » - 用 ToTabular 可将更多类型的表达式转换为 Tabular, 并对怎样完成转换有更多的控制.
- Tabular[data,schm] 可设置或修改表格 data 的架构,其中以 TabularSchema 对象或关联 <"prop1"val1,… > 的形式给出 schm.
- 可用 Tabular[spec] 中以下形式的 spec 创建 SQL 支持的表格对象:
-
RelationalDatabase[…] 包含单个表格的关系数据库对象 RelationalDatabase[…]"table" 从关系数据库中选择表格 <"RelationalDatabase"RelationalDatabase[…],"Query""table" > 数据库中表格的扩展指定 - Tabular 可识别缺失值或异常值(如 Missing[]、Null、Infinity 等)并进行操作.
- 可用 Part、Select 等提取数据元素.
- 可用 FromTabular 或 Normal 将Tabular 转换成其他形式.
- Tabular 可与转换函数一起使用,如 TransformColumns 和 AggregateRows.
范例
打开所有单元关闭所有单元基本范例 (5)常见实例总结
从矩阵创建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-yfffws
从矩阵创建 Tabular 对象,同时指定列键 (column key):
https://wolfram.com/xid/0ftuab4-w8hrc3
从有共同键的关联列表创建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-2avp5r
根据列数据组成的列表创建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-3g7zda
https://wolfram.com/xid/0ftuab4-r7w8kk
范围 (28)标准用法实例范围调查
创建表格对象 (12)
从行列表构建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-xv1g4j
从矩阵构建 Tabular 对象,同时指定列的名称:
https://wolfram.com/xid/0ftuab4-8bsw9d
从关联列表构建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-rr7nij
从关联列表构建 Tabular 对象,其中含有 ExtendedKey:
https://wolfram.com/xid/0ftuab4-9rflva
从 QuantityArray 创建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-u1gqke
https://wolfram.com/xid/0ftuab4-kdeloh
从按列排列的列表数据创建的 Tabular 对象需要进行 Transpose:
https://wolfram.com/xid/0ftuab4-sfgg1w
https://wolfram.com/xid/0ftuab4-ev0sb2
https://wolfram.com/xid/0ftuab4-tk6q43
使用 ToTabular:
https://wolfram.com/xid/0ftuab4-ok21qv
https://wolfram.com/xid/0ftuab4-crogh3
转换成 Tabular 将展平数据集的结构:
https://wolfram.com/xid/0ftuab4-g0pg2u
Import "CSV" 数据将自动得到一个 Tabular 对象:
https://wolfram.com/xid/0ftuab4-pyqn10
导入一个 "TSV" 文件:
https://wolfram.com/xid/0ftuab4-wbbpgd
构建数字组成的 Tabular 对象,指定每列元素的类型:
https://wolfram.com/xid/0ftuab4-0pqy61
https://wolfram.com/xid/0ftuab4-czj5nu
https://wolfram.com/xid/0ftuab4-qcqgsq
https://wolfram.com/xid/0ftuab4-0zt3dg
https://wolfram.com/xid/0ftuab4-c4azhl
默认情况下,Tabular 将它们存储为字符串:
https://wolfram.com/xid/0ftuab4-1kftxb
将其转换为 "CategoricalOrdered" 类型,并在内部单独存储每个大小值的副本:
https://wolfram.com/xid/0ftuab4-op4yc2
https://wolfram.com/xid/0ftuab4-tp1jur
显示一个 Tabular 对象,其行对应于实体,其列对应于实体的属性:
https://wolfram.com/xid/0ftuab4-8xvgse
提取数据 (9)
https://wolfram.com/xid/0ftuab4-47udmu
https://wolfram.com/xid/0ftuab4-4mkc9z
提取只有一个元素的 Tabular 对象:
https://wolfram.com/xid/0ftuab4-vtlhyx
https://wolfram.com/xid/0ftuab4-yjkr38
https://wolfram.com/xid/0ftuab4-wchbri
https://wolfram.com/xid/0ftuab4-bjc2ti
https://wolfram.com/xid/0ftuab4-ex71vh
https://wolfram.com/xid/0ftuab4-hi8yie
https://wolfram.com/xid/0ftuab4-662tb6
https://wolfram.com/xid/0ftuab4-2ze1rr
https://wolfram.com/xid/0ftuab4-puqsyx
https://wolfram.com/xid/0ftuab4-jjw8v4
https://wolfram.com/xid/0ftuab4-3vgqhe
用 key 列提取 Tabular 对象中的一行数据:
https://wolfram.com/xid/0ftuab4-nfo1ie
https://wolfram.com/xid/0ftuab4-8ssj5b
https://wolfram.com/xid/0ftuab4-c60v2z
https://wolfram.com/xid/0ftuab4-igtrtf
用几个 key 列提取 Tabular 对象中的一行数据:
https://wolfram.com/xid/0ftuab4-by90no
https://wolfram.com/xid/0ftuab4-y9z5px
https://wolfram.com/xid/0ftuab4-wr2fss
https://wolfram.com/xid/0ftuab4-migwak
从 Tabular 对象中提取多个列:
https://wolfram.com/xid/0ftuab4-c2laap
https://wolfram.com/xid/0ftuab4-1gs7a8
https://wolfram.com/xid/0ftuab4-509l1k
https://wolfram.com/xid/0ftuab4-jizy8j
提取 "SepalLength" 大于或等于 6 的所有行:
https://wolfram.com/xid/0ftuab4-uur19s
https://wolfram.com/xid/0ftuab4-dyciby
https://wolfram.com/xid/0ftuab4-j7w4ih
https://wolfram.com/xid/0ftuab4-taualn
清理数据 (4)
取一个包含国家数据的 Tabular 对象:
https://wolfram.com/xid/0ftuab4-bcz09b
https://wolfram.com/xid/0ftuab4-eec7cw
https://wolfram.com/xid/0ftuab4-y0j0fn
https://wolfram.com/xid/0ftuab4-ea2n0c
https://wolfram.com/xid/0ftuab4-goxcpz
https://wolfram.com/xid/0ftuab4-hr6l3w
https://wolfram.com/xid/0ftuab4-sy426s
https://wolfram.com/xid/0ftuab4-p0vijv
https://wolfram.com/xid/0ftuab4-bkmwz5
转换数据 (3)
https://wolfram.com/xid/0ftuab4-v9ulzz
https://wolfram.com/xid/0ftuab4-5r1gy7
https://wolfram.com/xid/0ftuab4-n0twdu
https://wolfram.com/xid/0ftuab4-lf01yr
https://wolfram.com/xid/0ftuab4-1hh8yw
https://wolfram.com/xid/0ftuab4-0tlv8k
应用 (2)用该函数可以解决的问题范例
用 Tabular 对象显示具有单独列标题的列数据:
https://wolfram.com/xid/0ftuab4-z8dvrf
https://wolfram.com/xid/0ftuab4-t54lm8
用数组数据和 "ColumnHeadings" 属性创建 Tabular 对象:
https://wolfram.com/xid/0ftuab4-dph5os
https://wolfram.com/xid/0ftuab4-g7v36n
https://wolfram.com/xid/0ftuab4-vlv4a8
https://wolfram.com/xid/0ftuab4-ekgg2r
以 Tabular 形式给出的 "DuneBooks" 的信息:
https://wolfram.com/xid/0ftuab4-btlcoo
属性和关系 (3)函数的属性及与其他函数的关联
https://wolfram.com/xid/0ftuab4-85cu5
https://wolfram.com/xid/0ftuab4-yfqps6
以 TabularColumn 对象的形式给出Tabular 对象的列:
https://wolfram.com/xid/0ftuab4-13no8b
https://wolfram.com/xid/0ftuab4-w27etb
https://wolfram.com/xid/0ftuab4-iyq56p
https://wolfram.com/xid/0ftuab4-hkh2j4
https://wolfram.com/xid/0ftuab4-y0vp4p
以 TabularRow 对象的形式给出Tabular 对象的行:
https://wolfram.com/xid/0ftuab4-gb1168
https://wolfram.com/xid/0ftuab4-t6e56a
https://wolfram.com/xid/0ftuab4-npgsuj
https://wolfram.com/xid/0ftuab4-0kt65g
https://wolfram.com/xid/0ftuab4-ih8nyr
可能存在的问题 (3)常见隐患和异常行为
Tabular 输入数据必须至少是二维的:
https://wolfram.com/xid/0ftuab4-qg19yn
https://wolfram.com/xid/0ftuab4-x4i6uj
https://wolfram.com/xid/0ftuab4-5le63t
https://wolfram.com/xid/0ftuab4-1pg62s
https://wolfram.com/xid/0ftuab4-b2qwpq
https://wolfram.com/xid/0ftuab4-r1etqg
Tabular 对象不能有重复的列键,使用 Part 将自动删除重复的内容:
https://wolfram.com/xid/0ftuab4-jcx0ks
https://wolfram.com/xid/0ftuab4-eaqkt8
映射 Part 提取出来的内容,生成相同的列:
https://wolfram.com/xid/0ftuab4-p188ta
创建没有列键的 Tabular 对象,或使列的键不同:
https://wolfram.com/xid/0ftuab4-iof1st
Wolfram Research (2025),Tabular,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Tabular.html.
文本
Wolfram Research (2025),Tabular,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Tabular.html.
Wolfram Research (2025),Tabular,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Tabular.html.
CMS
Wolfram 语言. 2025. "Tabular." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/Tabular.html.
Wolfram 语言. 2025. "Tabular." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/Tabular.html.
APA
Wolfram 语言. (2025). Tabular. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Tabular.html 年
Wolfram 语言. (2025). Tabular. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Tabular.html 年
BibTeX
@misc{reference.wolfram_2025_tabular, author="Wolfram Research", title="{Tabular}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Tabular.html}", note=[Accessed: 23-January-2025
]}
BibLaTeX
@online{reference.wolfram_2025_tabular, organization={Wolfram Research}, title={Tabular}, year={2025}, url={https://reference.wolfram.com/language/ref/Tabular.html}, note=[Accessed: 23-January-2025
]}