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

handling string during file loading #47

Closed
Mossybeam opened this issue Aug 16, 2023 · 8 comments
Closed

handling string during file loading #47

Mossybeam opened this issue Aug 16, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Mossybeam
Copy link

Hello everyone,

sorry if this is a newbie question, but upon loading the file, I run into a 'could not convert string to float: '0,00000E+000' error.
My Gamry outpul .DATA files contain scientific notation of numbers and apparently the loading of the file and conversion to pd.dataframe has an issue with that.
What were your solutions/what am I doing wrong?

Thanks for any advice

@bcliang
Copy link
Owner

bcliang commented Aug 31, 2023

@Mossybeam -- any chance you can share a snippet of the data file? Thanks.

@bcliang bcliang self-assigned this Aug 31, 2023
@bcliang bcliang added the bug Something isn't working label Aug 31, 2023
@wotgit
Copy link

wotgit commented Feb 25, 2024

Hello everyone,

sorry if this is a newbie question, but upon loading the file, I run into a 'could not convert string to float: '0,00000E+000' error. My Gamry outpul .DATA files contain scientific notation of numbers and apparently the loading of the file and conversion to pd.dataframe has an issue with that. What were your solutions/what am I doing wrong?

Thanks for any advice

Hi!
I'm having the same issue has there been found a solution already?

@bcliang
Copy link
Owner

bcliang commented Feb 26, 2024

@wotgit Any chance you can post a sample data file? You can remove any sensitive information from the file if needed.

@wotgit
Copy link

wotgit commented Feb 26, 2024

Sure! Here is one to test with. https://we.tl/t-vwr9533K2g

@bcliang
Copy link
Owner

bcliang commented Feb 29, 2024

@wotgit @Mossybeam
I looked at the file supplied by wotgit. I was able to properly load the EISPOT curves by defining an appropriate locale. Here is a minimal example that loads the curves properly:

import locale
import gamry_parser as parser

# set the desired locale
locale.setlocale(locale.LC_ALL, "de_DE.utf8")

# parse the data using the Impedance subclass
eis = parser.Impedance(filename="SampleData.DTA")
eis.load()

..
# do something with the data

This should work for any DTA file. Hope this helps.

@wotgit
Copy link

wotgit commented Feb 29, 2024

@bcliang thanks for your answer! I'm trying your example but I'm getting the following error:
eis = parser.Impedance(filename=path)
^^^^^^
NameError: name 'parser' is not defined

@bcliang
Copy link
Owner

bcliang commented Feb 29, 2024

@wotgit Apologies. I updated the example with the import statement import gamry_parser as parser

@wotgit
Copy link

wotgit commented Mar 4, 2024

@bcliang thanks it works now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants