Friday, March 31, 2017

THE CONTINUATION OF SMILES AND PYTHON

Assalamualaikum w.b.t everyone !

For this post we would like to share a little bit more about SMILES and introduce our new topic which is PYTHON.

For the cyclic structures that have branches, for example the bromochlorobenzene below :


If we use the carbon that connected with other compounds (for the structure above, Cl and Br) as carbon 1 (C1), we can arranged the notation either clockwise or anti-clockwise direction. 

If clockwise, we have to put 2 '@' symbols. For example, c1(@@)(Br)cccc(Cl)c1
If anti-clockwise, we have to put only 1 '@" symbol. For example, c1(@)(Br)cc(Cl)cccc1

The notation of carbon can be written in capital or small letter.

If we want to use capital letter for carbon notation, we have to put colon sign (:) between each carbon.


Capital letter - C1:C:C:C:C:C1
Small letter - c1cccccc1


Okay we are done with SMILES, next we would like to introduce you to PYTHON.

1) What is python? What is difference between python and C?

Python is high-level programming language for general-purpose programming. It is an easy-to-use language that make it simple to get program working.

The differences between python and C are : 

a) Python developed in 1991 while C developed in 1972
b) Python has much more shorter learning than C and will help creating program in a short period of time
c) Most experts agree that C is approximately ten times faster during run time.
d) For python, the coding will automatically saved while for C, the coding is manually saved.
e) Python can accept error in coding and still display the output while C will not accept even the slightest error in coding and it will not display the output.
f) For python, the coding is easier and shorter while C, the coding is long and complex.
g) For python, indentation is necessary and required while C, it is up to the programmer.
h) Dropbox, Youtube, Instagram use python while iOS, Google, Mozilla and Microsoft use C.


2) How to install python?

Here are steps to install python :

a) Search the website, python.org in the internet. Look for download button at the top and the picture below will show up.


b) Choose either one file according to the operating system of your PC as shown above
c) The file will be automatically downloaded in your PC and click run. The picture below will show up. 

d) But this version is not a full version.
e) We can download full version in ‘anaconda continuum’ website.
f) We just need to click on python 3.6.1. which is the latest version and choose the file that suitable for your pc.
g) But the one in anaconda continuum need large space to be downloaded in our pc. For beginner, the version of python is ‘miniconda’ is sufficient for us because even though the one in anaconda in the full version which comprise all of the application in python, but application provided by python downloaded from miniconda is just enough for undergraduate level.


3) What are the python libraries?

Python library is a collection of functions and methods that allows you to perform lots of actions 
without writing your own code.

For example, if you are working with data, numpy, scipy, pandas, etc. are the libraries you must know.
They have very convenient data transformation functions that will save you life time to do small tricks.



These are the examples of python libraries websites.

4) What is python editor?

Python editor is used to ease the function of python.
The examples of python editor are Jupyter Notebook and IPython.
IPython introduced a new tool named Notebook. It offers a modern and powerful web interface to python. This interface can be used with dozen of other languages such as R and Julia.

5) What are the data types?

Python has 5 standard data types :
- numbers (there are three types of numbers : int, float, complex)
- string ( use slice operators ([] and [:]))
- list (contains item seperated by commas and enclosed within square bracket([]))
- tuple (similar to the list, but consist of a number of values separated by commas)
- dictionary (enclosed by curly braces ({}) and values can be assigned using square braces ([]))

Some examples of data types are shown above.

6) How to print and display a word (Hello) in Python?


Just type : print ('Hello') and the word Hello will appear below the code.

7) How to generate a plot in Python?

a) Choose the preferred plot in matplotlib gallery (python script)
b) Copy the code 
c) Paste the code in Jupyter Notebook 
d) Press enter and your plot will be displayed. 
p/s: you can change the axis and the features of the plot


So, that's all from us. Hope you will enjoy and do not forget to try it on your own !!!!! 
Byebye ^^




No comments:

Post a Comment