From bc92d356e7a5c91c8c89322d40bbbe9bbd294b76 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Fri, 28 Jul 2023 15:17:59 +0200 Subject: Resolving pandas warning by copying dataframe instead of making a view. --- src/argaze/GazeFeatures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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])) -- cgit v1.1