aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-28 15:17:59 +0200
committerThéo de la Hogue2023-07-28 15:17:59 +0200
commitbc92d356e7a5c91c8c89322d40bbbe9bbd294b76 (patch)
tree24e216e0a0364f0c17c5eb6b911f5e84ac18d400
parent56c9e7893eebc53010e59740cfbf67808d9db247 (diff)
downloadargaze-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.py6
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]))