Skip to main content

Attribute

GitHub source

Attribute

evo.objects.typed.attributes.Attribute

A Geoscience Object Attribute

key

key: str

The key used to identify this attribute.

This is required to be unique within a group of attributes.

attribute_type

attribute_type: str

The type of this attribute.

exists

exists: bool

Whether this attribute exists on the object.

Returns:

TypeDescription
boolTrue for existing attributes.

to_dataframe

to_dataframe(fb: IFeedback = NoFeedback) -> pd.DataFrame

Load a DataFrame containing the values for this attribute from the object.

Parameters:

NameTypeDescriptionDefault
fbIFeedbackOptional feedback object to report download progress.NoFeedback

Returns:

TypeDescription
DataFrameThe loaded DataFrame with values for this attribute, applying lookup table and NaN values as specified. The column name will be updated to match the attribute name.

set_attribute_values

set_attribute_values(df: DataFrame, infer_attribute_type: bool = False, fb: IFeedback = NoFeedback) -> None

Update the values of this attribute.

Parameters:

NameTypeDescriptionDefault
dfDataFrameDataFrame containing the new values for this attribute. The DataFrame should contain a single column.required
infer_attribute_typeboolWhether to infer the attribute type from the DataFrame. If False, the existing attribute type will be used.False
fbIFeedbackOptional feedback object to report upload progress.NoFeedback

What is the reason for your feedback?