You are here

Finally! Some Code... and Indian Food

Week 5 (July 8 – July 12, 2013):

Monday: Continued learning Python 2.6.8. and had a professional development meeting on technical writing.

Tuesday: Received some test data from Charles in a txt. file with 11 columns and 21 rows of positive or negative numbers. The first column was of expected output and the others were inputs of the function. My goal was to read this file into Python and modify a program file called pyevvolve_ex18.gp.py to run a symbolic regression on that data.

            I first googled, “How to read text files in Python” and that led me to the Python documentation that I had read regarding that topic, then to http://docs.python.org/2.6/tutorial/inputoutput.html to get help. That seemed to not help me find a way to read the text file the way I wanted so I looked a couple more sites for assistance. I eventually found http://stackoverflow.com/questions/9508662/how-can-i-read-a-text-file-in-python and I found this code:

            f = open(‘test.txt’, ‘r’)            # open in read mode

            data = f.read()

            print data

After formatting this code and my command prompt to my needs, I was able to view the information in the text file the way I wanted. It wasn’t huge discovery, but for me it was the first time I successfully printed text file data.

            The next thing I did was to download Notepad++ from http://notepad-plus-plus.org/ and installed it in my laptop so as to change the code of a file titled, pyevolve_ex19_gp. I made a duplicate and saved it so I can manipulate the code within for my data. During this time I also started an outline for tomorrow’s midterm presentation, had meeting with Charles to work on some symbolic regression programming and preparing for midterm the next day.

Wednesday: Prepared for midterm presentation by finalizing information and images on PowerPoint slides, got some help with Charles clearing up some information about what the software programs are outputting, eventually went to the presentation gathering to listen to others present and presented as well. Later, had a small daily meeting with Charles, and then organized for second half of project. Eventually, I worked on some code that Charles wanted me to work on.

Thursday: Continued working on the code that Charles emailed to me yesterday. Eventually I used other code that I found on page from the Matlab website (http://matplotlib.org/examples/pylab_examples/accented_text.html) and able to get a liner function on a graph. This was another milestone in my quest to becoming a more knowledgeable programmer. Next, I was successful at producing a sin wave function by using code from this site: http://matplotlib.org/examples/pylab_examples/axes_props.html. http://stackoverflow.com/questions/1532810/how-to-read-lines-from-a-file-into-a-multidimensional-array-or-an-array-of-list, and had a productive 1-hour meeting with Charles. Later, continued to work on changing code in file pyevolve_ex18a_gp.

Friday: Looked up description of xrange function and found that it’s useful for saving memory space when using large amounts of data. This is an advantage over the range() function since we are using a large amount. Then, I attempted to adjust code as suggested by my mentor in file pyevolve_ex18a_gp. Soon after, I started looking into some theory of genetic programming.



I really appreciated this week. I finally got to work on code and my mentor treated me to lunch. This was the first time we got to talk with each other on a social level and I got to know some things about him. Also, I got to eat some Indian food for the very first time! This was a great week!