Menu

How to read data in to Minsky

2018-04-30
2018-05-04
  • David March

    David March - 2018-04-30

    I need to read in a list (CSV) of a numberical value for each time step. How can I accomplish this?
    Thank you
    Dave

     
    • High Performance Coder

      On Mon, Apr 30, 2018 at 09:18:54PM -0000, David March wrote:

      I need to read in a list (CSV) of a numberical value for each time step. How can I accomplish this?
      Thank you
      Dave

      You add a "data operation", which looks like a trangle with a cylinder
      superimposed (like a database flowchart symbol). Then you can import a
      CSV file (space separated, not comma separated IIRC) into that, and it
      will then interpolate the data op input using that time series.

      It is fairly limited functionality, but it will do what you want. I
      suggest you read that section of the manual for more details.

      Cheers


      Dr Russell Standish Phone 0425 253119 (mobile)
      Principal, High Performance Coders
      Visiting Senior Research Fellow hpcoder@hpcoders.com.au
      Economics, Kingston University http://www.hpcoders.com.au


       
      • David March

        David March - 2018-05-01

        Thanks. I would have never gotten that interpretation from the widget help / description. But now that you suggested it, I got it. Thanks and sorry for the stupid question.
        Dave

         
        • High Performance Coder

          On Tue, May 01, 2018 at 09:19:57PM -0000, David March wrote:

          Thanks. I would have never gotten that interpretation from the widget help / description. But now that you suggested it, I got it. Thanks and sorry for the stupid question.

          It is not a stupid question! It indicates that discoverability could
          be improved. Do you have any suggestions how to improve that section
          of the manual?

          --


          Dr Russell Standish Phone 0425 253119 (mobile)
          Principal, High Performance Coders
          Visiting Senior Research Fellow hpcoder@hpcoders.com.au
          Economics, Kingston University http://www.hpcoders.com.au


           
      • David March

        David March - 2018-05-02

        Sorry to bother you, but I can not get the data object to work with a file. It works fine with the random generator, but not a file. I put the time into the input, read in a file that has two numbers on each line. I have tried both space separated and tab separated. Neither work.
        It is a simple text file. The first column number is just an assending sequence. The second column number is just a constant (though I have tried many different things). No matter what is in the second column, the output of the data widget is always one. The simple test file looks like this:
        1 10
        2 10
        3 10
        4 10
        5 10
        etc.

        It always outputs one. no matter what is in column 2.

        Any idea what I am doing wrong?
        THank you
        Dave March

         
        • High Performance Coder

          On Wed, May 02, 2018 at 10:44:00PM -0000, David March wrote:

          Sorry to bother you, but I can not get the data object to work with a file. It works fine with the random generator, but not a file. I put the time into the input, read in a file that has two numbers on each line. I have tried both space separated and tab separated. Neither work.
          It is a simple text file. The first column number is just an assending sequence. The second column number is just a constant (though I have tried many different things). No matter what is in the second column, the output of the data widget is always one. The simple test file looks like this:
          1 10
          2 10
          3 10
          4 10
          5 10
          etc.

          It always outputs one. no matter what is in column 2.

          Any idea what I am doing wrong?

          You might need to send me your .mky file so that I can see. I cut and
          pasted the above into a test file, loaded it into a data widget, and
          the output is a constant 10, as you would expect.... You have the data
          format correct.

          --


          Dr Russell Standish Phone 0425 253119 (mobile)
          Principal, High Performance Coders
          Visiting Senior Research Fellow hpcoder@hpcoders.com.au
          Economics, Kingston University http://www.hpcoders.com.au


           
          • David March

            David March - 2018-05-03

            I tried the same thing no go. I copied the data from the email, put it into a file and wired the model the same as the manual example, except using a data import rather than the random function. I have attached the model and the data file.
            Thanks
            Dave

             
  • High Performance Coder

    The problem appears to be the presence of a space in the file name. I renamed the file to testAgain.txt, and it imported just fine.

    This appears to be TCL issue, rather than a Minsky bug, but please raise a Minsky ticket, and I'll take a look at workarounds for when people put spaces in their file names. In the meantime, please avoid the spaces in the filenames...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.