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

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
主站蜘蛛池模板: 博白县| 锡林浩特市| 呼伦贝尔市| 全州县| 广昌县| 雷山县| 仁怀市| 关岭| 五常市| 南雄市| 铜川市| 边坝县| 雷州市| 若尔盖县| 随州市| 太康县| 灵宝市| 唐海县| 施秉县| 竹北市| 石门县| 唐海县| 永丰县| 隆德县| 宜黄县| 泸溪县| 凤庆县| 大连市| 涟水县| 肥西县| 巴中市| 宁陕县| 探索| 宜兴市| 宁河县| 墨玉县| 娄底市| 永顺县| 昌乐县| 南丰县| 沙湾县|