Code Monkey home page Code Monkey logo

Comments (2)

vyrjana avatar vyrjana commented on May 29, 2024

The value of path is used to document where the data came from, but it is not read. The first parameter of the pyimpspec.dataframe_to_data_sets function should be your pandas.DataFrame object that contains all of the data that you want to turn into one or more pyimpspec.DataSet objects. The value of path could be any string (even an empty string), but ideally it would be the path to the file that you parsed in order to get the data that you have in your pandas.DataFrame object. The value of path is also used to figure out a default value for the label parameter if you don't provide a value for label (e.g., path='/foo/bar/baz.txt' means that the default value for label is 'baz' if you don't provide another value for label).

Once you have your pyimpspec.DataSet objects, you can later on call the get_path method if you need to find out which file one of those objects corresponds to. Pyimpspec may also use the value of path in some cases to make it clear which file the analysis results correspond to. Below is an example where I used the command line interface of pyimspec via the Bash shell to fit a circuit consisting of one resistance to replicate measurements located in separate files by using the wildcard, *, to select all files that match the pattern C1*.xlsx (e.g., C1-1.xlsx and C1-2.xlsx) in the current folder. In this case, pyimpspec prints out the relative paths just before each set of results.

> pyimpspec fit "R" C1*.xlsx
C1-1.xlsx
CDC: [R]

| Element   | Parameter   |   Value |   Std. err. (%) | Unit   | Fixed   |
|:----------|:------------|--------:|----------------:|:-------|:--------|
| R_1       | R           | 575.739 |      0.00748923 | ohm    | No      |

| Label                          | Value               |
|:-------------------------------|:--------------------|
| Log pseudo chi-squared         | -5.533406855983064  |
| Log chi-squared                | -6.251845637980951  |
| Log chi-squared (reduced)      | -7.8646294947006865 |
| Akaike info. criterion         | -759.5891998959225  |
| Bayesian info. criterion       | -757.8515302776392  |
| Degrees of freedom             | 41                  |
| Number of data points          | 42                  |
| Number of function evaluations | 82                  |
| Method                         | cg                  |
| Weight                         | modulus             |

C1-2.xlsx
CDC: [R]

| Element   | Parameter   |   Value |   Std. err. (%) | Unit   | Fixed   |
|:----------|:------------|--------:|----------------:|:-------|:--------|
| R_1       | R           | 575.766 |       0.0357865 | ohm    | No      |

| Label                          | Value              |
|:-------------------------------|:-------------------|
| Log pseudo chi-squared         | -5.499914548531639 |
| Log chi-squared                | -5.811390468156221 |
| Log chi-squared (reduced)      | -7.424174324875956 |
| Akaike info. criterion         | -716.9934085527578 |
| Bayesian info. criterion       | -715.2557389344745 |
| Degrees of freedom             | 41                 |
| Number of data points          | 42                 |
| Number of function evaluations | 30                 |
| Method                         | least_squares      |
| Weight                         | modulus            |

If you have already parsed the data (frequencies and impedances) from a file, then you could also just use those to create a pyimpspec.DataSet object. The pyimpspec.dataframe_to_data_sets is mainly to reduce code duplication across the parsers for the various supported file formats. The function also helps with handling cases where a single file might contain multiple frequency sweeps by splitting such data into multiple pyimpspec.DataSet objects. Note that the path parameter is optional in the pyimpspec.DataSet constructor, but the value of path is used in the same way (i.e., just to help keep track of which file the data corresponds to).

from pyimpspec.

xiaowodaweiwang avatar xiaowodaweiwang commented on May 29, 2024

Hi, I've understand what you mean, Thanks a lot.
Best wishes!

from pyimpspec.

Related Issues (5)

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.