功能:更新指定方向数据集的系列类别。
该方法将更新特定方向数据集的系列类别,并返回更新后的数据集。
语法:update_series_category(series, new_category)
参数:
series:(pandas DataFrame) 指定方向数据集,必须包含以下列: 'X', 'Y', 'Z', 'azimuth', 'dip',并且为空或非空。new_category:(str) 指定方向数据集的新系列类别,长度不得超过20个字符。返回值:
updated_series:(pandas DataFrame) 更新后的特定方向数据集。说明:
update_series_category 操作的是 Orientations 中指定方向的数据集。from Gempy.core.data_modules.geometric_data import Orientations
# 创建一个方向数据集
data = {'X': [1, 2, 3, 4], 'Y': [5, 6, 7, 8], 'Z': [9, 10, 11, 12],
        'azimuth': [0, 10, 20, 30], 'dip': [45, 50, 55, 60]}
orientation_data = Orientations(data)
# 更新指定方向数据集的系列类别
updated_data = orientation_data.update_series_category(orientation_data.data, 'New_Category')
print(updated_data)
输出:
     X  Y   Z  azimuth  dip       series
0  1.0  5   9      0.0   45  New_Category
1  2.0  6  10     10.0   50  New_Category
2  3.0  7  11     20.0   55  New_Category
3  4.0  8  12     30.0   60  New_Category