官术网_书友最值得收藏!

Collection Types

Collections of values appear everywhere in programs, and Julia has the most important built-in collection types. In Chapter 2, Variables, Types, and Operations, we introduced two important types of collection: arrays and tuples. In this chapter, we will look more deeply into multidimensional arrays (or matrices), and into the tuple type as well. A dictionary type, where you can look up a value through a key, is indispensable in a modern language, and Julia has this too. Finally, we will explore the set type. Like arrays, all these types are parameterized; the type of their elements can be specified at the time of object construction.

Collections are also iterable types, the types over which we can loop with for or an iterator producing each element of the collection successively. The iterable types include string, range, array, tuple, dictionary, and set.

So, the following are the topics for this chapter:

  • Matrices
  • Tuples
  • Dictionaries
  • Sets
  • An example project—word frequency
主站蜘蛛池模板: 南昌县| 濮阳市| 南乐县| 宁南县| 潮安县| 文山县| 什邡市| 恭城| 临沂市| 永泰县| 枝江市| 新密市| 永嘉县| 三门县| 新巴尔虎右旗| 宁德市| 山阳县| 黑水县| 竹溪县| 铅山县| 顺昌县| 福泉市| 南昌县| 屯昌县| 元江| 集贤县| 金阳县| 囊谦县| 西峡县| 宽甸| 东平县| 玉林市| 山西省| 永兴县| 台州市| 确山县| 潜江市| 井冈山市| 苍溪县| 湘乡市| 于都县|