Day 2: Python

Since after I kicked off the online learning on Python 4 days ago, it is time for more write up. The first day with Python, I came across the function of print statement, how to look into the syntax error, the usage of variables and how to perform arithmetic operations using the variables. It is a simple start for now.

I looked into the python.org website to get more information about the standard operators. They can perform standard mathematics operation, logical operation, object comparison and sequence comparison.

The link below shows the details of the operator symbols in the Python syntax and the functions in the operator module. Zoom to 10.3.1. Mapping Operators to Functions. The basic addition, subtraction, multiply, division, modulus are common. We can also use the concatenation for combining two or more strings.

One interesting part i found from the table is slicing, something that I did not know at this point of time how it works. Let me find out more and I will share again.

I found the website is good for more reading and understanding. It can be a little bit dry to read through the huge chunk of information, however, they are useful.

Today is a bit short, I will write and share more in the next few days.

Summary of the day:

  • familiar myself with python documentation.
  • found interesting topic about slicing.

URL: https://docs.python.org/3.4/library/operator.html

Advertisements

Day 2: Window Shopping at Seomyeon Underground Shopping Center

Shortly after I finished my dinner, I decided to take a walk and do some window shopping at Seomyeon Underground Shopping Center which is located right at Seomyeon Station. It is one of the recommended shopping centers in the tourism websites. 

This place is huge, mainly selling clothing. The pricing here is comparable with those in Seoul, however, design wise, I feel Seoul is more fashionable. Since, I visited the place during the autumn season, most of the clothing are mainly long jackets and winter clothes.

I intended to get another jacket so that I can change it during my trip because I brought two jackets only. However, I did not shop anything at this place because I did not want to carry them back to Seoul. 

Day 2: Dinner at Hwajeon Guksu

Hwajeon Guksu, Busan.

After detoured to my hostel to rest and re-charge my phone and power bank, I got ready for a dinner nearby the Seomyeon Station. Having the daily pass which costs 5000₩, I was able to travel around Busan using the subway unlimited time. It is convenient to use and I am able to travel more places at anytime without hassle.

That was why I could plan my dinner further from my hostel. I took the subway from Daeyeon Station to Seomyeon Station Line 2. I took the Exit 2 upon reached Seomyeon Station and followed the Google Map to the location.

Unfortunately, I was not able to locate the restaurant when I reached the destionation. Little that I know, the restaurant is located at the back of a little alley in between two shops. The shop is selling guksu (Korean noodle) at the price of 2500₩, the cheapest meal so far in Busan. The concept in this restaurant is pay first when ordering the food, before they serve it.

It was a meatless guksu with plenty of seaweed and sesame seeds. The soup broth was clear, easy to go with the noodle. The amount of noodle was generous, no wonder so many people ordered it without extra dishes. Most importantly, the noodle did not turn soggy. As usual, the table will have a pot of kimchi, free flow for us. You can help yourself to get a cup of plain water which is also free. I saw the man in front of me walked to the counter to get some pickled radish. Although it is simple, yet it can be quite feeling without taking much of the soup. 

맛있다.

The ambiance of the restaurant is decent and level of noisiness is normal. The waitress is attentive, just a little language barrier with my limited Korean. Again, there is no issues to eat alone and some walk-in patrons just sit together with me on the same table.

Address: 17-2 Jungang-daero 702beon-gil, Bujeon 2(i)-dong, Busanjin-gu, Busan, South Korea.

Day 2: Detour From Busan to Penang

After the late lunch, I walked back to the subway station and took a subway to 
Oncheonjang Station Line 1 to visit the Geumjeongsanseong Fortress (금정산성) for afternoon hiking. Luck was not on my side, it was raining quite heavy when I reached the station. Due to the wet weather, I could not walk out to the bus stop to catch the bus to the destination. I spent a while walking around the station to explore while waiting for the rain to stop. However, it still rained.

I planned to take a train down to Seomyeon Station Line 1 and looked around for a cafe to sit down for tea break while waiting the rain to stop. However, when the train reached Seomyeon Station, I decided to change to Line 2 and went back to hostel to rest. 

You must be thinking what a waste! I tried to enjoy my holiday with slow pace. This detour allowed me to explore a little bit of the area nearby my hostel. 

Maybe not many people will notice about this drawing on the wall. A sister and a younger brother were supposed to be on a bicycle. The kids on bicycle made famous in Penang, Malaysia, was drew by Ernest Zacharevic.

Day 2: Lunch at Gupo Guksu

Gupo Guksu (구포국수)

After spending my relaxing hours at the Beomeosa Temple,  it was time to have lunch. I took the same bus back to the bus stop to catch a train to Namsan-dong for lunch. The restaurant was recommended in one of the booklet I took from the Korea Tourism Board in Singapore.

It is located quite a distance away from the Namsan subway which is one station away from Beomeosa subway Line 1.

The 30 years restaurant serves deep flavoured anchovy-broth noodle. It says that we need to wait during peak hour and during my lunch time visitation to the restaurant there was no huge crowd. Serving only guksu (Korean noodle) in different sizes; small, medium and large. There is no English menu and the waitress speaks no English.

I walked so far, of course I ordered the medium sized guksu which costs 5000₩ to satisfy my stomach. It serves with pickled radish, green chilies and a kettle of soup. It is pretty special presentation to me and to be honest, it is first time I eat in Korean restaurant which serves food in this method.

Topping the noodle with minced chili gives them a crisp taste, so I did. Yes, just a little bit and then I poured the soup into the bowl of noodle up to the level I am comfortable with.

You can drink the soup with the stainless steel cup as I saw some people did so. However, the broth is made of anchovies and it is quite strong taste to just drink the soup. It is up to individual preferences.

With seaweed and kelp, it may look simple and meatless, the generous amount of noodle for a medium sized bowl of noodle, can truly make my stomach full after a half day of long walk.

Forget to mention, the radish is free flow.

How to search this restaurant? It was a bit tricky for me to locate the restaurant after my Google map lost its direction again.

By following the map on the website I found on the spot, it is going up hill straight by walking after exiting the Namsan Subway Line 1 Exit 7. A more direct way to go up the hill will be walking down the main street until you see the hospital at the T junction, then turn left into Namsan-ro, continue walking up the hill, which took me quite some time and energy until you see a school, where you make a left turn. The restaurant is just around that corner.

Alternatively, you can take a bus to go up the hill where the bus stop is just nearby the restaurant too.

There is no issues for me to have my meal alone at this restaurant as they serve for one person too. It is just the language barrier with the waitress, yet it is not a problem at all.

Address: 989-13, Namsan-dong, Geumjeong-gu, Busan, Korea.

Day 1: Let Get Started with Python

After attended the event and workshops organized by the CodingGirls, the interests to learn on Python, R, Tableau and SAS zoomed into my life. One of my colleagues gave some insights of what skills I should learn in order to move into data analytics field. My colleagues and myself intended to pick up the programming language through the Udemy’s online courses. We wanted to take advantage of the Black Friday’s Sales

For a start, I did the python 3 installation on my machine. For Window, it is straight forward with using the .exe file, I just have to follow the steps and complete the installation without hassle. To make sure I have installed the python 3, I can easily check by opening the command prompt and type,

python –version

Let’s get started.

Regardless which website you start with, make sure complete the whole course to get the understanding of Python. Some online learning websites provide interactive python code editor where you can write the codes and run it from the website, while some others will teach you how to install applications to do it.

Eventually, we will write our codes and run it from an application. Choose one which you are comfortable to begin with. For my case, I am going to work with IntelliJ which is freeware and Jupyter’s Notebook online version.

Alright, back to my first lesson. I did a small, quick start with trying my hand on using the print statements. There are syntax and functionality difference between Python 2 and 3, the fundamentals are all the same. Let’s begin with a baby step.

While double-quotes (“) and single-quotes (‘) are both acceptable ways to define a string or a text. A string needs to be opened and closed by the same type of quote mark. Text in Python is considered a data type of string which it can contain letters, numbers and symbols. We can concatenate (combine) the texts using +

We can use triple quotes (“””) for a string to span multiple lines and assign it to a variable. One of the examples I learned,

haiku = “””The old pond,
A frog jumps in:
Plop!, we expected: The old pond,
A frog jumps in:
Plop!”””

Another usage of triple quotes (“””) as docstrings. Docstrings describe what the function does. It serves as a documentation for the function and it is placed immediately after the function’s header.

For example,

def square (value):
  """Return a value of the square"""
  new_value = value ** 2
  return(new_value)

This looks pretty easy to start off, right? 

Next, the errorhandling while we running the code, the editor shows the SyntaxError to tell us where it goes wrong. Example, this error is due missing the quotation marks.

Then, I moved deeper into using the variables. When my colleagues built web applications, they constantly dealt with changing of data. It  found it irritating when I saw the source code hard-coded with data. It will turn out to be inconvenient if we need to constantly change the texts or data we coded into our script. Python uses variables to define things that are subject to change. Each variable that you derive can be used to store texts, numbers or dates. 

Similarly to writing SQL scripts, wherever possible, I will use variables to define values subjected to change, in a way, we can dynamically use our script. 

Variables

  • Specific and case-sensitive name, best practice to use lowercase.
  • Define things that are subject to change.
  • Can be used to store texts, numbers or dates.
  • Cannot start with number.
  • Cannot use space  and symbols in the name, use _ instead.

This is how we define the variable and assign the value. You can see how it assigns date, string of text and number.

Python uses dynamic typing. What does it mean?

It means we can reassign variables to different data types. It makes python easily assigning data types, this different than other programming languages that are statically-typed.  Other than python, do you know what other programming languages have similar characteristic?

So, what do Python calls for these different types of values?

Built-in Types:

  • Boolean operations: and, or, not (true, false)
  • Numeric types: int, float, complex (number, decimal)
  • Text sequence type: str (string)
  • Sequence type: list, tuple, range
  • Mapping type: dict 
  • Sets type: set

It looks a little complex now but do not worry about them. We will use them quite often later. Let us look at some samples of how to derive variables in Python with different data type. More data type can be found from the Internet.

Now, we can look into using arithmetic operations with variables. The variable will be used to hold the final result of each operation. Arithmetic operations follow the precedence of the operators. Detail of the precedence can be found from the Internet.

Summary of the day:

  • installation of python 3.
  • print() statement.
  • single quote, double quotes, triple quotes.
  • how does SyntaxError look like?
  • how to define and use variable.
  • built-in types.
  • basic arithmetic operators.

‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine

I was working on a complex query and required a dataset to be uploaded into my local machine’s database. The file format of the dataset was excel file and I was using the SQL Server Management Studio (SSMS) to upload the dataset into the database. 

Unfortunately, the SSMS returned an error message after I have selected my source as excel file. The error message was ‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine.

For my case, the fixes for this error is done by installing the Microsoft Access Database Engine driver. The installation is simple, straight forward and hassle free. It does not require the machine to be restarted in order to continue importing the dataset using excel file.

Reference link: https://social.msdn.microsoft.com/Forums/en-US/1d5c04c7-157f-4955-a14b-41d912d50a64/how-to-fix-error-quotthe-microsoftaceoledb120-provider-is-not-registered-on-the-local?forum=vstsdb