Is there a way to select a specific string from bt.list.

16 views
Skip to first unread message

Songsheng Tao

unread,
Aug 27, 2020, 12:55:27 PM8/27/20
to xpd-users
The beamtime "bt" object has the attribute "samples" and this attribute is an ordered dictionary. This dictionary is a mapping from the sample name to the dictionary of sample information.

If you would like to get one of the sample names by the index you can do. Here I take a sample with index 1 as an example.

`list(bt.samples.keys())[1]`

If you would like to get all the name of the samples in a list:

`list(bt.samples.keys())`

If you would like to get the sample information by key.

`bt.samples["LaB6"]`

If you would like to get the sample information by index.

`list(bt.samples.values())[1]`

If you would like to get all the sample information.

`list(bt.samples.values())` # return a list

`bt.samples` # return a dictionary
Reply all
Reply to author
Forward
0 new messages