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

Querying a list of exchanges

An exchange is a marketplace where instruments are traded. Exchanges ensure that the trading process is fair and happens in an orderly fashion at all times. Usually, a broker supports multiple exchanges. This recipe demonstrates how to find the list of exchanges supported by the broker.

Getting ready

Make sure the instruments object is available in your Python namespace. Refer to the second recipe of this chapter to learn how to set up this object.

How to do it…

Display the exchanges supported by the broker:

>>> exchanges = instruments.exchange.unique()
>>> print(exchanges)

You will get the following output:

['BCD' 'BSE' 'NSE' 'CDS' 'MCX' 'NFO']

How it works…

instruments.exchange returns a pandas.Series object. Its unique() method returns a numpy.ndarray object consisting of unique exchanges supported by the broker.

主站蜘蛛池模板: 保靖县| 麻阳| 桂林市| 红桥区| 尼勒克县| 庄河市| 黑山县| 汤原县| 郧西县| 遂宁市| 壤塘县| 丰都县| 自贡市| 乐陵市| 汝城县| 青冈县| 灵川县| 威宁| 凭祥市| 叶城县| 西林县| 安福县| 丽水市| 睢宁县| 成都市| 靖江市| 金川县| 荣成市| 江西省| 栾川县| 徐汇区| 西乌| 洪江市| 灵石县| 郸城县| 伊宁县| 定日县| 大同市| 甘南县| 上饶县| 珠海市|