Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FutureWarning] Resolving the warning related to the use of a single-element series. #7813

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions examples/pytorch/eeg-gcnn/EEGGraphDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,22 @@ def get_sensor_distances(self):
def get_geodesic_distance(
self, montage_sensor1_idx, montage_sensor2_idx, coords_1010
):
def get_coord(ref_sensor, coord):
return float(
(coords_1010[coords_1010.label == ref_sensor][coord]).iloc[0]
)

# get the reference sensor in the 10-10 system for the current montage pair in 10-20 system
ref_sensor1 = self.ref_names[montage_sensor1_idx]
ref_sensor2 = self.ref_names[montage_sensor2_idx]

x1 = float(coords_1010[coords_1010.label == ref_sensor1]["x"])
y1 = float(coords_1010[coords_1010.label == ref_sensor1]["y"])
z1 = float(coords_1010[coords_1010.label == ref_sensor1]["z"])
x1 = get_coord(ref_sensor1, "x")
y1 = get_coord(ref_sensor1, "y")
z1 = get_coord(ref_sensor1, "z")

x2 = float(coords_1010[coords_1010.label == ref_sensor2]["x"])
y2 = float(coords_1010[coords_1010.label == ref_sensor2]["y"])
z2 = float(coords_1010[coords_1010.label == ref_sensor2]["z"])
x2 = get_coord(ref_sensor2, "x")
y2 = get_coord(ref_sensor2, "y")
z2 = get_coord(ref_sensor2, "z")

# https://math.stackexchange.com/questions/1304169/distance-between-two-points-on-a-sphere
r = 1 # since coords are on unit sphere
Expand Down
Loading