Tuesday, November 19, 2019

Where do i begin?


It took me a little over four hours straight to generate an output of SEVEN lines in Python! Two lines was just plain text, three lines were computations, and another two lines was formatting the output. On top of that, the script needed to include creating a text file with the output. 

  Financial Analysis
  ----------------------------
  Total Months: 86
  Total: $38382578
  Average  Change: $-2315.12
  Greatest Increase in Profits: Feb-2012 ($1926159)
  Greatest Decrease in Profits: Sep-2013 ($-2196167)

We just wrapped up the first week of learning the language. Before starting the bootcamp, I spent a good amount of time learning the basics of Python through online courses, YouTube tutorials, and web articles. I have a degree in Computer Science so picking up the concepts wasn't too difficult. But for someone who has absolutely no STEM background, I would understand how challenging it can get to grasp so much information in so little time. So I was asked, "Where do I begin?".

I am a complete beginner to Python as well and below are the steps I did to perform the task:

1) Know the basics. I've already done so as I mentioned above. There are so many free resources online. One YouTube channel I particularly liked was: CS Dojo. The Python Tutorial documentation is a good one. You can also try courses on Udacity or Codecademy for hands-on learning. The Coding Bat site is great practice! These are just a few of hundreds of resources online. 

2) Solve the problem one line at a time. The text output was pretty straightforward. To do the computations, I did the next step.

3) The data source only contained two columns and about 270 rows. So I used Excel to solve the computational problems to make sure I am getting the correct solution. Obviously, if the data set was too large this would not be possible. But since this is a beginner assignment I took the Excel route. Now that I have the correct solution, next step was how to convert that into Python code.

4) For the most part, I used lists and list comprehension. I knew what I wanted to do, but I didn't have the knowledge yet on what functions existed (if there were any) to get a specific output. So if there is something you do not know, Google or Stack Overflow is your best friend. If you ask the right questions, you will find what you are looking for. And to know the right questions, you will have known what it is you specifically want to happen. 

The four hours was time well spent, my Python knowledge just increased. Assignment number one is done! I continue to try to improve my script so off to code some more.



No comments

Post a Comment