0

I have a bunch of uff files and im trying to write a code that opens the file and converts it to csv.

this is my code so far

import pandas as pd

import pyuff as pu

uff_file = pu.UFF(r'C:\Users\name\Downloads\WEICAN#1.uff')

uff_file.get_set_types()

data = uff_file.read_sets()

data[4].keys()

#test = pd.read_csv(r'C:\Users\name\Downloads\WEICAN#1.uff')

#test.to_csv(r'C:\Users\name\Downloads\WEICAN#1.csv', index=None)

i get this as the error when i try to run it but im not really sure what it means.

Traceback (most recent call last):
  File "C:\Users\name\PycharmProjects\pythonProject\venv\lib\site-packages\pyuff\datasets\dataset_58.py", line 267, in _extract58
    [float(line[13 * (i + j) + 20 * (i):13 * (i + 1) + 20 * (i + j)]) \
  File "C:\Users\name\PycharmProjects\pythonProject\venv\lib\site-packages\pyuff\datasets\dataset_58.py", line 267, in <listcomp>
    [float(line[13 * (i + j) + 20 * (i):13 * (i + 1) + 20 * (i + j)]) \
ValueError: could not convert string to float: '000E+00  2.679853248'

During handling of the above exception, another exception occurred:

Wondering if you have any tips or pointers to put me on the right track. Thanks

Edo Akse
  • 4,051
  • 2
  • 10
  • 21
Blewson
  • 1
  • 1
  • Check the uff files you want to read are supported [ref](https://pyuff.readthedocs.io/en/latest/Supported_datasets.html) by your lib – Efren May 17 '22 at 01:11
  • Please provide enough code so others can better understand or reproduce the problem. – Community May 17 '22 at 01:12

0 Answers0