Giter Club home page Giter Club logo

Comments (1)

mdmurbach avatar mdmurbach commented on June 12, 2024

👋 @nickbrady thanks for filing the issue and sharing your solution! In this case, I think parsing the columns is great. Would you be willing to submit a pull request (feel free to post here if you have any questions)?

One suggestion I might make is that I think this solution will throw an index error if a column doesn't exist (when it tries to get the [0] from an empty list), so it'd probably be good to add a step to check that it exists first and raise a more meaningful error, e.g.

headers = lines[number_header_lines-1].split('\t')
freq_cols = [o for o, h in enumerate(headers) if h == 'freq/Hz']
ReZ_cols = [o for o, h in enumerate(headers) if h == 'Re(Z)/Ohm']
ImZ_cols = [o for o, h in enumerate(headers) if h == '-Im(Z)/Ohm']

for cols in [freq_cols, ReZ_cols, ImZ_cols]:
    assert len(cols) > 0, f'{cols} not found in header ({headers})'

freq_col = freq_cols[0]
ReZ_col = ReZ_cols[0]
ImZ_cols = ImZ_cols[0]

from impedance.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.