Skip to content

Commit df4151f

Browse files
committed
Avoid LossySetitemError on pandas >= 3.0
1 parent 8368c6a commit df4151f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/pyntcloud/io/las.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ def convert_color_to_dtype(data, output_dtype):
5151
f"Invalid color dtype. Expected one of ['uint8', 'uint16'], but got {input_dtype}"
5252
)
5353
if input_dtype == "uint8" and output_dtype == "uint16":
54-
data["points"].loc[:, column_names] *= 256
54+
data["points"][column_names] *= 256
5555
elif input_dtype == "uint16" and output_dtype == "uint8":
56-
column_max_values = data["points"].loc[:, column_names].max()
56+
column_max_values = data["points"][column_names].max()
5757
# Do not scale color values restricted to [0, 255]
5858
if column_max_values.to_numpy().max() >= 256:
59-
data["points"].loc[:, column_names] /= 256
59+
data["points"][column_names] /= 256
6060
data["points"] = data["points"].astype(
6161
{"red": output_dtype, "green": output_dtype, "blue": output_dtype}
6262
)

0 commit comments

Comments
 (0)