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

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
主站蜘蛛池模板: 北辰区| 罗源县| 凭祥市| 壶关县| 衡南县| 榆林市| 宁强县| 清原| 永平县| 静宁县| 尚义县| 四子王旗| 克山县| 西乌珠穆沁旗| 郴州市| 金阳县| 扎兰屯市| 富裕县| 方山县| 河池市| 大冶市| 德昌县| 仁寿县| 江川县| 天津市| 濉溪县| 常山县| 六盘水市| 乌恰县| 新和县| 马尔康县| 渝北区| 华容县| 英德市| 正蓝旗| 娄烦县| 天全县| 镶黄旗| 通城县| 东至县| 湘西|