From 27e0d28679872078b2d4aabd32c1c8d049e5f2be Mon Sep 17 00:00:00 2001 From: tflidd Date: Thu, 23 Nov 2023 10:23:57 +0100 Subject: [PATCH 1/2] Fix Deprecation warnings using pandas keys --- pyntcloud/io/ply.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyntcloud/io/ply.py b/pyntcloud/io/ply.py index 6deda6e..ec4e179 100644 --- a/pyntcloud/io/ply.py +++ b/pyntcloud/io/ply.py @@ -255,9 +255,6 @@ def describe_element(name, df): element.append("property list uchar int vertex_indices") else: - for i in range(len(df.columns)): - # get first letter of dtype to infer format - f = property_formats[str(df.dtypes[i])[0]] - element.append('property ' + f + ' ' + df.columns.values[i]) + element += [f'property {property_formats[str(datatype)[0]]} {name}' for name, datatype in df.dtypes.items()] return element From 4532caf6cde6bfd6ef74039feac4efa96e6ae27e Mon Sep 17 00:00:00 2001 From: tflidd Date: Thu, 23 Nov 2023 10:25:08 +0100 Subject: [PATCH 2/2] fix flake8 syntax error --- pyntcloud/io/ply.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyntcloud/io/ply.py b/pyntcloud/io/ply.py index ec4e179..b0b42e7 100644 --- a/pyntcloud/io/ply.py +++ b/pyntcloud/io/ply.py @@ -139,7 +139,7 @@ def read_ply(filename, allow_bool=False): data["points"][col] = data["points"][col].astype( dtypes["vertex"][n][1]) - if mesh_size : + if mesh_size: top = count + points_size names = np.array([x[0] for x in dtypes["face"]])