diff options
author | Théo de la Hogue | 2023-07-28 15:17:59 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-07-28 15:17:59 +0200 |
commit | bc92d356e7a5c91c8c89322d40bbbe9bbd294b76 (patch) | |
tree | 24e216e0a0364f0c17c5eb6b911f5e84ac18d400 | |
parent | 56c9e7893eebc53010e59740cfbf67808d9db247 (diff) | |
download | argaze-bc92d356e7a5c91c8c89322d40bbbe9bbd294b76.zip argaze-bc92d356e7a5c91c8c89322d40bbbe9bbd294b76.tar.gz argaze-bc92d356e7a5c91c8c89322d40bbbe9bbd294b76.tar.bz2 argaze-bc92d356e7a5c91c8c89322d40bbbe9bbd294b76.tar.xz |
Resolving pandas warning by copying dataframe instead of making a view.
-rw-r--r-- | src/argaze/GazeFeatures.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index e92e41c..574727c 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -166,14 +166,14 @@ class TimeStampedGazePositions(DataStructures.TimeStampedBuffer): precision: specific precision column label if exist. """ - # Select columns + # Copy columns if precision: - df = dataframe[[timestamp, x, y, precision]] + df = dataframe.loc[:, (timestamp, x, y, precision)] else: - df = dataframe[[timestamp, x, y]] + df = dataframe.loc[:, (timestamp, x, y)] # Merge x and y columns into one 'value' column df['value'] = tuple(zip(df[x], df[y])) |