Skip to main content

Posts

Showing posts with the label date formats

The XLRD python module for reading the spreadsheet documents - Introduction

xlrd module for python is an awesome module  and I think it is a must for each and every pythonist to have a basic knowledge of this module . This module reads the data in the excel sheets or sometimes called as spreadsheets and thus the data can be used for computation(s) in our python scripts. But a serious problem I have faced is, when I wanted to use this module it had a documentation which was not in the style of readthedocs . There was one xlrd readthedocs but at the time of writing this post it was empty. Eventhough I searched the internet( google ) and have learnt on this module myself, I wanted to create and share my knowledge as a documentation for this module in the form of readthedocs not using the sphinx but manually writing each and everything. A harley davidson style. Encoding used This module(xlrd) uses unicode encoding . It is known that from Excel 97 onwards the data is stored in unicode format but the prior versions had some other encoding ....

Rejecting the applications that are not fit using Matlab

Program Let us say that you have got a client who is a HR Manager of a company. Understand the situation below. The company has given a notification in a newspaper for an opening and around 10 people has turned up. The selection process was three stages out of which for two stages your client want you to sort out the applicants. In the first stage a question paper for 5 marks is given and in the second stage a question paper for 5 marks is given while third stage is interview. They store the marks of the candidates in a file which has the data which looks as follows: Id Number Paper 1 Paper 2 1 1.5317 4.6950 2 2.5425 4.3797 3 2.5539 2.7508 4 4.0881 3.1124 5 3.9742 2.9352 6 3.2216 1.0387 7 1.8930 1.5062 8 4.0579 2.3546 9 2.6641 1.1524 10 1.7536 4.2215 such that it h...

Display the current date and time in Matlab, Using Built-in Function clock

Problem Ask the user for the format of the date required, so that the person selects the format according to his/her convenience, and after the user gives the required date format then display the date and time in a neat and clear way so that the user understands the date and time accordingly. For this problem use the most common date formats. Use the built-in function clock in Matlab to accomplish this task. Solution Before we solve this problem let us first find the most common date formats so that we can proceed forward. By doing some Google Search  and found these as the common types: 1) DD-MM-YYYY 2) MM-DD-YYYY 3) YYYY-MM-DD 4) YYYY-DD-MM If you feel that there are few more of date formats then please feel free to add them to your script. For now let us stick to the above to solve the problem because solving the problem to know the Matlab concepts is important than any other stuff. To know more about the date formats used in different countries then see: Wik...