Dated
更多信息
- 在 Dated[obj,date] 中,obj 可以是 Entity 对象、EntityProperty 对象、或是表示实体属性的字符串.
- 在 Dated[obj,year] 中,可以用整数给出年代.
- 在 Dated[obj,date] 中,date 用 DateObject 指定.
- 在使用 Dated[obj,All] 请求数据时,通常会返回一个时间序列.
范例
打开所有单元 关闭所有单元基本范例 (3)
Dated[Entity["Country", "France"], 1985]Dated[Entity["Country", "France"], 1985]["Population"]Dated 也可以用于 EntityProperty 表达式中:
Dated[EntityProperty["City", "PerCapitaIncome"], DateObject[{2010}, "Year", "Gregorian", -6.]]Dated[EntityProperty["City", "PerCapitaIncome"], DateObject[{2010}, "Year", "Gregorian", -6.]][Entity["City", {"Chicago", "Illinois", "UnitedStates"}]]还可以在 Dated 封装字符串形式的属性名称:
EntityValue[Entity["Planet", "Mars"], Dated["DistanceFromEarth", DateObject[{1985, 8, 4}, "Day", "Gregorian", -6.]]]范围 (2)
当在实体中使用 Dated 时,没有日期要求的属性会忽略日期参数:
EntityValue[Dated[Entity["Planet", "Mars"], DateObject[{1986, 10, 13}, "Day", "Gregorian", -6.]], "Mass"]当在不需要日期的属性中使用 Dated 时,会返回 Missing[…]:
EntityValue[Entity["Planet", "Mars"], Dated["Mass", DateObject[{1986, 10, 13}, "Day", "Gregorian", -6.]]]如果在实体和属性中都用到了 Dated,实际会使用和属性关联的日期:
EntityValue[Dated[Entity["Star", "HIP44511"], DateObject[{2010}, "Year", "Gregorian", -6.]], Dated[EntityProperty["Star", "DistanceFromSun"], DateObject[{1990}, "Year", "Gregorian", -6.]]]推广和延伸 (2)
years = DateRange[DateObject[{2017}], DateObject[{2022}], "Years"];Entity["Company", "Apple::5zkjq"][Dated[EntityProperty["Company", "NetIncome"], #]& /@ years]EntityValue[Dated[Entity["Company", "Apple::5zkjq"], #]& /@ years, EntityProperty["Company", "NetIncome"]]wind2010 = Dated[EntityProperty["Country", "ElectricityWind"], 2010];EntityClass["Country", wind2010 -> TakeLargest[5]][wind2010, "Association"]应用 (10)
EntityList[EntityClass["Planet", "DistanceFromEarth" -> TakeSmallest[2]]]EntityList[EntityClass["Planet", Dated["DistanceFromEarth", DateObject[{2023, 2, 2}, "Day"]] -> TakeSmallest[2]]]查询 2023 年 1 月至 10 月期间水星和火星与地球的距离:
EntityValue[{Entity["Planet", "Mercury"], Entity["Planet", "Mars"]}, Dated["DistanceFromEarth", #]& /@ DateRange[DateObject[{2023, 1}, "Month"], DateObject[{2023, 10}, "Month"], "Months"], "EntityAssociation"]ListPlot[%, Joined -> True]Dated[Entity["Country", "UnitedStates"], DateObject[{2022, 1, 1}]]["RetailSales"]Dated[Entity["Country", "UnitedStates"], 2020][{EntityProperty["Country", "MoneySupply", {"Component" -> "M1"}], EntityProperty["Country", "MoneySupply", {"Component" -> "M2"}]}]1965 年至 2000 年间美国实际 GDP 年增长率的历史变化图:
DateListPlot[Entity["Country", "UnitedStates"][Dated[EntityProperty["Country", "GrossDomesticProduct", {"Adjustment" -> "Real", "TimeSeriesOperator" -> "AnnualizedChangeRate"}], Interval[{DateObject[{1965}, "Year"], DateObject[{2000}, "Year"]}]]]]绘制自 1978 年以来美国国债除以美国国内生产总值的历史图:
DateListPlot[Entity["Country", "UnitedStates"][Dated[EntityProperty["Country", "GrossDomesticProduct"], Interval[{DateObject[{1978}, "Year"], Today}]]] / Entity["Country", "UnitedStates"][Dated[EntityProperty["Country", "FederalDebt"], Interval[{DateObject[{1978}, "Year"], Today}]]]]sectors = {"FinalProducts", "ConsumerGoods", "BusinessEquipment", "Manufacturing", "Materials", "Mining", "ElectricGasUtilities"};
PieChart[Dated[Entity["Country", "UnitedStates"], 1995][EntityProperty["Country", "IndustrialProduction", {"ProductionSector" -> #}]& /@ sectors], ChartLegends -> sectors]Dated[{Entity["AdministrativeDivision", {"Illinois", "UnitedStates"}], Entity["AdministrativeDivision", {"Wisconsin", "UnitedStates"}]}, DateObject[{1996, 3}]]["CivilianUnemploymentRate", "Association"]绘制凤凰城、圣路易斯和迈阿密从 2010 年开始的住房价格的历史数据图:
With[{cities = {Entity["City", {"Phoenix", "Arizona", "UnitedStates"}], Entity["City", {"SaintLouis", "Missouri", "UnitedStates"}], Entity["City", {"Miami", "Florida", "UnitedStates"}]}}, DateListPlot[Dated[cities, Interval[{DateObject[{2010}], Today}]]["MedianHomeListingPrice"], PlotLegends -> cities]]绘制美国中西部各州 2020 年人均 GDP 的地理区域值图:
GeoRegionValuePlot[EntityList@EntityClass["AdministrativeDivision", "USStatesMidwest"] -> Dated[EntityProperty["AdministrativeDivision", "GrossDomesticProduct", {"Modifier" -> "PerCapita"}], 2020]]相关指南
-
▪
- 日期和时间 ▪
- 社会经济和人口统计数据 ▪
- 知识表示和访问 ▪
- 时间和事件序列数据源
文本
Wolfram Research (2016),Dated,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Dated.html.
CMS
Wolfram 语言. 2016. "Dated." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/Dated.html.
APA
Wolfram 语言. (2016). Dated. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Dated.html 年
BibTeX
@misc{reference.wolfram_2026_dated, author="Wolfram Research", title="{Dated}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/Dated.html}", note=[Accessed: 08-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_dated, organization={Wolfram Research}, title={Dated}, year={2016}, url={https://reference.wolfram.com/language/ref/Dated.html}, note=[Accessed: 08-September-2026]}