NUMERICAL ANALYSIS HELP: HOW CAN I ?

190 views
Skip to first unread message

Adolfo

unread,
May 7, 2015, 7:13:18 PM5/7/15
to python-g...@googlegroups.com

Hi:

I have been looking int Python in an unorganized way for sometime thinking that I like the definition of a script language. Now I have a specific task, and I am looking for some help in figuring out what should I learn for this task:

I have to look into the frequency of occurrence of lists of numbers. First I have to start with two digit numbers in rows of six to ten.

Example:
  • how many times does the number 03 occurred in each row of six numbers
  • how many times the number 03 occurred in each location of the six possible places
  • a total count of the occurrence of each number
  • and so on.
Thus, beyond the job or reading a file which I can learn on youtube. Do I need to build a database that can keep the rows and columns, so I can use other tools to dig out my answers?
I found the term "numerical analysis" but it sounds
to me bigger than my seeeminly small task .

Thus the overall questions is ¿what learning path shoud I follow to accomplish this task?

Any help will be much appreciated.

Adolfo Aguirre....doing native forest restoration in Chile



MattMel

unread,
May 12, 2015, 9:55:47 AM5/12/15
to python-g...@googlegroups.com
Hi Adolfo!

This looks like a good project to help you learn! 

  1. Yes, First step is reading from a file. I'm not sure what type of file you are reading from, but if it's just a .txt it's not too hard. Check out the Python Documentation on I/O. Specifically Section 7.2. I also like to reference Tutorial Point since it's a little easier to read, but it's not as comprehensive. It's always good to get used to reading the official documentation!
  2. No, you do not need a database for this type of project, but you do need a data structure! (depending on how the input file is formatted, this might not be strictly necessary for this project, but learn it! You will need knowledge of data structures to do most anything.) This project is probably best served with Python Lists, but I can not over-emphasize the importance of data structures. Learn them
  3. You'll also need to loop over the data structure you create. This can be done with, you guessed it, Loops! Read the pages about for loops, while loops, and nested loops. You could use either a for loop or a while loop and depending on your implementation, you may need to nest them as well.
  4. Numerical Analysis is certainly not the term you were looking for! In fact, I'm not really sure what that term means in this context. 
    1. Anyway, the first component of what you're looking for are Booleans! (you don't need to read that one... Lots of extra information). Booleans are a data type, or to put it more generally, a type of information. Examples or these "types of information" are numbers or words (these have other names in programming with other subtleties, but we're just getting concepts here. read about int's, float's, and string's if you're curious) Read about booleans.
    2. Read about Operators. Read about all of them. You'll need comparison operators to do your "searching" and you'll need the arithmetic operators for counting.
    3. You will also need to read about decision making. If-Else statements 
Take your time and learn all of these concepts and you'll find that this project isn't hard at all. Also, please note that my list above is organized by the way I thought through how to program the solution. Not the order you should learn the material in. In fact, it might be precisely the opposite of the most logical order... 

Hope this helps! I'm by no means a Python guru but feel free to reach out to me if you have any specific questions. 


P.S. Google is a programmers best friend. You're in a Google Group right now so I assume you must be familiar. Google anything you don't understand. There is so much information out there that is easily accessible with Google. Honestly, everything I've provided for you here was found with simple Google searches. I suppose the key is knowing what to search. 
Reply all
Reply to author
Forward
0 new messages