keep_variables(sampleset: SampleSet, variables: Iterable[Hashable]) SampleSet[source]#

Return a new sample set with only the given variables.

  • sampleset – A sample set.

  • variables – The variables to be kept. Must be a subset of the variables in the sample set.


A new sampleset with only the given variables kept. The energies, info and other data vectors will be the same as in the given sample set.