File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 20
20
import pandas as pd
21
21
from beartype import beartype
22
22
from beartype import typing
23
+ from copy import copy
23
24
24
25
25
26
@beartype ()
@@ -192,15 +193,15 @@ def get_transformation(
192
193
193
194
@beartype ()
194
195
def apply_transformation (
195
- data_anon : pd .DataFrame ,
196
+ data : pd .DataFrame ,
196
197
quasi_ident : typing .Union [typing .List , np .ndarray ],
197
198
hierarchies : dict ,
198
199
transformation : list ,
199
200
) -> pd .DataFrame :
200
201
"""Apply a given transformation to the data.
201
202
202
- :param data_anon : data under study.
203
- :type data_anon : pandas dataframe
203
+ :param data : data under study.
204
+ :type data : pandas dataframe
204
205
205
206
:param quasi_ident: list with the name of the columns of the dataframe
206
207
that are quasi-identifiers.
@@ -216,6 +217,7 @@ def apply_transformation(
216
217
:return: dataset generalized with the transformation given
217
218
:rtype: pandas dataframe
218
219
"""
220
+ data_anon = copy (data )
219
221
actual_transform = check_gen_level (data_anon , quasi_ident , hierarchies )
220
222
for i , qi in enumerate (quasi_ident ):
221
223
hierarchy_qi = hierarchies [qi ]
You can’t perform that action at this time.
0 commit comments