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

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
主站蜘蛛池模板: 海宁市| 宿松县| 涿州市| 宜君县| 高雄市| 白朗县| 凤山市| 民勤县| 杂多县| 深水埗区| 迭部县| 黄陵县| 电白县| 汉寿县| 南平市| 晋宁县| 阜平县| 安远县| 固原市| 邹平县| 元阳县| 馆陶县| 莱阳市| 沙雅县| 文成县| 高邮市| 综艺| 南丰县| 天柱县| 高平市| 德格县| 武胜县| 柯坪县| 宜川县| 双桥区| 蕉岭县| 宜黄县| 托克托县| 阿克| 图木舒克市| 潮州市|