EasyPlotFile.add_column

EasyPlotFile.add_column(column_data, header=None, index=None, func_args=None, replace=False, setas=None)

Append a column of data or inserts a column to a datafile instance.

Parameters

column_data (numpy.array or list or callable) – Data to append or insert or a callable function that will generate new data

Keyword Arguments
  • header (string) – The text to set the column header to, if not supplied then defaults to ‘col#’

  • index (index type) – The index (numeric or string) to insert (or replace) the data

  • func_args (dict) – If column_data is a callable object, then this argument can be used to supply a dictionary of function arguments to the callable object.

  • replace (bool) – Replace the data or insert the data (default)

  • setas (str) – Set the type of column (x,y,z data etc - see Stoner.Core.DataFile.setas)

Returns

self – The DataFile instance with the additonal column inserted.

Note

Like most DataFile methods, this method operates in-place in that it also modifies the original DataFile Instance as well as returning it.