Wednesday, June 17, 2020

Data Cleansing Tips using Excel


When you import data from different sources, you would like to do some initial assessment of the data and ensure it is cleansed. This is a preparatory step before deciding further statistical analysis. Here, I describe 6 important functions that are quite useful in data cleansing and understanding. 

Empty data

How do you remove the empty rows?  These can be a nuisance when you would like to do further operations on the data set. When you plan to apply regression and other modelling techniques, the empty cells can play truant.  

#1 – Find the empty cells of data. In the Toolbar Ribbon, go to “Find & Select” / “Go to Special”. Choose “Blanks”. It will highlight the blank rows.  

#2 – Fill or delete the empty cells. You can fill them up with any text. Once such cells are highlight (as a result of the earlier step), type the text you want and press CTRL + ENTER. All the empty cells will be filled up with whatever you have typed. If not, you may have to do this for every such empty cell. IF you want to delete, just right click and choose the option of “delete rows.” 

Duplicate data

#1 – Check for duplicate rows - Some transactions could be repeated accidentally. We need to ensure that the data set contains no duplicates.  Check for existence of such rows of data by using conditional formatting. Under that option, choose “Duplicate values” under “Highlight cell rules”. Of course, you can select any desired formatting. 

#2 – Delete the duplicate rows. For this, choose the relevant option under “Data”. You need to select which column on which this removal of duplicates will apply. 

Cleaning data

It is likely that some special characters might creep into the data when you are getting it from multiple sources and that too after some conversion. The data might come from application resulting in such special characters. 

Simply use the CLEAN function. For example, if the text is in cell B4, type in B5, CLEAN(B4). 

Remove unwanted spaces

Even after doing all these, there could be multiple spaces in between texts or at the beginning or at end. These are not removed by CLEAN function. For this, Excel gives us a beautiful function called TRIM. What does this do? This removes all multiple spaces and just keeps one space in between the words. Moreover, if there any leading spaces at the start of the data, that goes out. The same treatment is applied for the trailing spaces after the last word. 

Bring order

Especially for text fields, it may not be in a proper case. Upper and lower cases may have been used randomly. We have some beautiful functions to change the case. UPPER converts the text to full upper case; LOWER() changes to full lower case and PROPER() capitalizes the first alphabet of each word. Excel diligently applies this to texts embedded in numbers too. For example, a text in a cell “567BudGet” becomes 567Budget after PROPER() is applied. Unfortunately, in excel, we don’t have straightforward option for changing case or converting to Sentence case (that capitalizes only the first letter of the first word). For this, however, macros are available. 

Conditional Formatting 

I am sure you have tried using conditional formatting feature. I am a fan of it and use it all the time to focus on key data/rows. Few features you can apply on the data set (after cleansing it) to get a glimpse of outliers / exceptions are: 

  • Highlight cell values (that are greater or less than the average). For this, you can enter a custom formula using AVERAGE. 
  • Highlight the entire row values (meeting certain conditions). For this select the entire rows before defining your formula. 

You may want to do some selective data updates or cleansing on such rows before attempting further modelling. 

Good luck.

Saturday, May 9, 2020

The pursuit of Happiness




John Lennon wrote: "When I was five years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me that I didn't understand the assignment, and I told them they didn't understand life."



Since 1972, (yes, it is true!), Bhutan has been pursuing GNH (Gross National Happiness) as the guiding factor in all its development. Bhutan, a tiny Himalayan Kingdom, took this lead under the progressive King Jingme Wangchuk.



Can it be captured easily? Is it even simple to understand? Credit to Bhutan for integrating this concept into their development strategy. This seeks to strike a balance amongst the four pillars - sustainable and equitable socio-economic development; conservation of the environment; preservation and promotion of culture; and good governance.



The GNH Index includes nine domains
  • Living standards – material comforts measured by income, financial security, housing, asset ownership
  • Health – both physical and mental health.
  • Education – types of knowledge, values and skills
  • Good governance – how people perceive government functions.
  • Ecological diversity and resilience – peoples’ perception on environment.
  • Time use – how much time is spent on work, non-work, sleep; work-life balance.
  • Psychological wellbeing – quality of life, life satisfaction and spirituality.
  • Cultural diversity and resilience – strength of cultural traditions and festivals.
  • Community vitality – relationships and interaction

The GNH Index is decomposable by any demographic characteristic, meaning it can be broken down by population group, for example, to show the composition of GNH among men and among women, or by district, and by dimension, for example to show which group is lacking in education. The indicators and domains aim to emphasize different aspects of wellbeing, and different ways of meeting underlying human needs.

The 2015 GNH index shows that on the scale of zero to one measurement, the happiness of our people has increased from 0.743 in 2010 to 0.756 in 2015. That is, 1.8% overall increase. a. 91.2 % of people reported experiencing happiness, and b. 43.4% of people said that they are deeply happy.

Governance - The same King, who is revered and popular, took the bold step of introducing democratic reform in 2008. He felt the country's future cannot be in the hands of one individual.

Environment - Conservation ranks at the very top for this country. Bhutan is in the top 10 countries ranked in the order of species density. It is a bio-diversity hot spot. For example, the constitution says that 62% of the country should be under forest cover all the time.


Guess what is the current score? 72%. Further goals track carbon-neutrality with their ambition of going carbon-negative. More than 42% of the country comes under "protected land."



Culture - Its unique sandwiched position separated by high mountain passes has helped grow an isolated community. They have evolved their own culture, identity as well as language. The country celebrates this diversity of more than two dozen languages with regional festivals. The officials wear traditional dress to work. Culture is part of daily life.



Sustainable development - The government has constituted a Happiness Commission akin to a planning body. They subject all the policies of the government through a stress-test to ensure an equitable economic development.

Bhutan has been maintaining a very high profile in international bodies like Climate committees, OECD etc. It has inspired development of many different indices and has led from the front when it comes to holistic development.

Does it all mean that the Bhutanese are the happiest people on earth? Very difficult to answer this directly. The people there take time to think, to respond, to be with family etc. Both the older and future generations are hand-in-hand. TV was introduced in 1999. Smartphones have flooded the market. Certainly, this has complicated the matters. Alongside comes materialistic aspects. The good thing is that the country is not turning a blind eye to the unmindful and reckless development. Alongside, it continues to integrate and practice these happiness goals for the betterment of the country's future generation as well as that of the whole word. 


Certainly, there is more than a handful of lessons for other countries!

Saturday, May 2, 2020

A WFH (Work From Home) Checklist


How to work from home effectively? How to interact with team? How to give presentations to customers online? How can organizations rebuild or reorient themselves into the new culture?

This is not especially easy given the fact it is new to most people. Many of them might have been used to working for a few hours from home. Now, WFH means conceptually redesigning a part of your home as the workplace. A designated work place should be sacro-sanct. At the same time, one must not be immune to the fact the one is surrounded by their loved ones and a certain amount of distraction is bound to happen.

Here is a brief 3-point checklist for the organizations and the employees.

For the organizations:

1. Set up the base well i.e. provide for the best-in-class infrastructure

  • A stable, high-speed internet connection is a must. Reimburse the employees. The employees are saving the organizations a lot of money by being at home. This is the least they should get in order to discharge the responsibilities.
  • Devices (Desktop / Laptop) loaded with current software / Anti-virus
  • Consistent collaboration tools for performing meetings, audio / video sessions with colleagues and / or customers
  • Ensure security compliance / VPN availability / awareness training. Lot of security restrictions may be rendered irrelevant at home. Be mindful of that and inculcate standards

2. Publish business etiquette

  • Agree on working hours calendar (on a weekly or monthly basis)
  • Specify an “All-hands-available” window wherein every employee is expected to be online and can be accessed
  • Consistent calendar sharing with required permissions
  • Communicate constantly and consistently


3. Establish new support and care mechanisms

  • Host virtual get-togethers
  • Designate fun time / fun zone
  • Celebrate WINS
  • Bring life to festivals instead of a token “Wish you all…” and strengthen family bonding
  • Provide support mechanisms to reach out in case mental ill-health



For the employees:

1. Set up a “Chinese Wall” between household and office work

  • Some people designate a special area, inside the house, towards this purpose. This is a NO GO for other members. I have heard of people, dressed up in office wear, working from such area. This may not be feasible for everyone. It is important to designate a section (whether it is barred for others or not) and follow working protocol.
  • Use a good quality ear phones / ear plugs / noise cancelling equipment.
  • Adopt good ergonomic practices. This can include working whilst standing, moving around every hour, taking breaks etc.
  • Learn to switch off and resist the tendency to be available 24*7 online. WFH doesn’t mean that you are expected to be available all the time. It also doesn’t mean that you can prioritize other things over office work.

·
2. Working effectively

  • You should master the online ways of working, online meetings for effective work management. For example, one doesn’t have to use the phone all the time. Tools like MS Teams, Lync etc. provide opportunities for chatting.
  • Ensure you understand the audio / video bridge details / other collaboration tools.
  • It is not wise to do back-to-back meetings. Have your heard of people remarking that their entire days were taken up by meetings? It is not warranted and reflects inefficiency.
  • To make meetings more effective, be clear with the purpose, pre-requisites and decision criteria. If someone comes ill-prepared and takes up huge time of everyone, it would be more prudent to reschedule the meetings.
  • Use meeting recording function and notes function to share the minutes. It saves time by sending documents.
  • Break the project into smaller chunks where appropriate.

3. Be human

  • Show empathy, concern and understanding for your team members / colleagues.
  • Be magnanimous when required and give freedom to manage their internal schedules subject to an overarching and agreed protocol.
  • “Look” at your team members; get into video calls at least weekly.
  • Understand their issues and work with them to solve 


As I had explained in my earlier blog post, companies have discovered a golden goose in WFH. It is better to apply our mind, instill some disciplined process and get used to the new ways of working.

Good luck…


Friday, April 17, 2020

Leaders making a difference during the COVID crisis


Various counties have been following different approaches to tackle the COVID crisis. But a few stand out in their consistent thinking and implementation. New Zealand is a country that prides itself on tourism. But that country took a bold decision of shutting down tourism. They went ahead and imposed a month-long lockdown. The number of deaths in New Zealand is a minuscule.
Take Taiwan. Taiwan couldn't even be a member of WHO. Now it exports medical masks and related products. How is this possible? How did the country adopt protective measures? They started very early and without waiting for anyone, they went ahead.
Consider Germany. They were touted to become worse than Italy. Instead, they did something right.  Testing was given relentless focus. More than 350,000 tests are being conducted every week. Early detection became the mantra there.
I don't know if these countries share any common traits. One thing is clear. They are all led by women leaders. All have strong democracy. Most of the parties, cutting across political boundaries, come together more often for the welfare of the country. They have a very good infrastructure backed with good public health system. Interventions happened quite early. Tough restrictions were imposed on social gatherings and other activities. All energy was directed towards testing in an aggressive manner.
The case of Taiwan is noteworthy. Thanks to China, this country is shunned by WHO. Given the heavy traffic from China, this should be highly susceptible from day one. Instead, how did this nation go about? President Tsai Ing-wen systematically went about this. She ensured all air traffic from Wuhan underwent thorough testing. Severe restrictions were imposed on all flights. A command centre was introduced and production of masks and other equipment doubled up. Result? 6 deaths and < 400 confirmed cases.
Germany is another story. Very low death rate even though the infected were more than 150,000. The response, in Germany, can be summed up the view of Heidelberg Hospital's Head of Virology Dr Hans Krausslich. He remarked "Our strength in Germany is the rational decision making at the highest level combined with the trust the public have on the government machinery."
New Zealand's Prime Minister Jacine Ardern said "In the face of the greatest threat to human health we have seen in over a century, Kiwis have quietly and collectively implemented a nationwide wall of defense."
Amazing responses from these three women leaders who quietly went about, struck early and decisively and focused on testing. Their approach is paying rich dividends indeed.
There are a few other countries headed by women. Nordic states that routinely top any index, computed by UN, like Iceland, Finland have implemented competent measures. Ms Sanna Marin is the youngest leader in the world. Katrín Jakobsdóttir heads the tiny island state of Iceland. Of course, its population is around 350,000. Small indeed. But they went about testing aggressively. They brought out the fact that 50% of the positive cases do not exhibit any symptoms.
I couldn't help but appreciate the no-nonsense intent behind the following statement, made by the Prime Minister Silveria Jacobs. She oversees a tiny Caribbean island Sint Marteen of 40,000 people. 
"If you do not have the type of bread you like in your house, eat crackers. If you do not have bread, eat cereal. Eat oats" she says emphatically.


Sunday, April 12, 2020

A peek into Post-COVID "New Normal"


We all firmly believe the current lockdown and related restrictions due to COVID situation will be withdrawn soon. Some of us are more optimistic than others! Whatever it is, there would come a state where the current challenges to day to day life would disappear. 

The bigger question, then, is what will happen to the post-restriction period of day-to-day life? What will be the NEW-NORMAL ?

In economics, we have heard of elastic stimulus. As the stimulus gets in, changes happen; as its gets out, changes stop and original state returns. There is also something called plastic stimulus where the after-effects linger in varying proportions. The COVID situation can be analysed using this view point.

First, a brief summary of changes happening some possibly with unintended and unavoidable consequences:

  • Education – Major impact. Institutions and hostels closed. They are trying to restore normalcy through online learning.
  • Industries – Those service industries like IT/BPO, working from home has been enforced. Where there are restrictions due to regulations or lack of equipment, they are being addressed one by one. Home offices with proper equipment / software is being set up. Airlines, manufacturing shops, auto and ancillary factories are shut.
  • Hospitality & Leisure – Malls, retail stores, local kirana shops, gyms, cinema halls, parks and libraries closed. Online entertainment is on the high. More self-learning classes like Yoga, cooking, hair-cutting etc.
  • Religion – All places of worship are closed. We have seen virtual services.
  • Sports – Major sporting events have been called off or postponed indefinitely.
  • Government – Trying to do its bit with fiscal stimulus as well as containing the impact of the virus.
  • Online food orders (Uber eats or Swiggy), /TV viewing, time with family and children, in-house cooking, e-commerce purchase, higher usage of online media, gaming industry.

When the vaccine is found and all infections under control …, what will be the permanent effect of these?

  • Working from home is likely to become de rigueur. The companies might have found an inspirational cost reduction measure. CEOs of such companies will be thrilled as most of them double up as COOs.

  • What will happen to educational institutions? Can we imagine schools and colleges declaring at least one day a week as "work from home"? This will help to establish the required infrastructure, test it for rainy days and train teachers to switch instantly from real to virtual classroom. More innovative software platforms and solutions will fuel this transition.

  • There could be a spurt in the creative side of humans. Why? More time available. More quality time with lot of flexibility to adjust schedules. More time with life partners and children possibly leading to rediscovering the joy of human beings with frailties and mistakes. More magnanimity. More give and take and possibly fewer divorces! or will it be the other way? Too much of coming together might lead to more break-ups?

  • The joy of quality dining experience may come back.

  • People will have gotten used to more entertainment at home. Netflix and the like will rule, innovate and come up with new series practically every day! Internet based TV will be the order of the day. Going to cinema halls may not be the preferred mode.

  • The bane of many industries including travel and face to face meetings will slowly disappear. The joy of virtual meetings (whether out of compulsion or norm) will override everything. People will continue to be as effective or ineffective as before!

  • Telemedicine might become more practical and effective.

  • Phenomenal levels of innovation will happen.

  • Government will be forced to rethink its industrial and fiscal policies, setting up of export zones etc. It will go back to to drawing board to decide on this. Allocation of health expenditure might be on the rise.


Long term gainers – Personal & Healthcare, Technology, E-commerce, Food processing

Long term losers – Hospitality, Tourism, Leisure, Aviation, Maritime, Auto etc.