Digital life, towards well being

Arul
7 min readDec 18, 2020

Visualizing and analyzing user data using python

User Behavior Analytics (UBA) focuses on what the user is doing: apps launched, network activity, and, most critically files accessed (when the file or email was touched, who touched it, what was done with it and how frequently).

I use my “App usage” application to measure usage of phone. Lets see what are the things I have extracted from the data and what our phone know about us.

In this post, I will go through A. Introduction, B. Exploring the Data C. Analysis & Plotting, D.Conclusion.

Introduction

Digital well-being is a term used by health professionals, researchers and device manufacturers to describe the concept that when humans interact with technology, the experience should support mental and/or physical health in a measurable way. The goal of improving digital well-being is to design technology in such a way that it promotes healthy use and proactively assists the user to maintain a healthy lifestyle. You can find it in your phone. in setting → Digital well-being

When you open it you can see a dashboard which shows the time spent on various app. it hold the history of 1 week of your usage. Here in order to get the data so I used some other app named “app usage”.

What is App usage?

App Usage is an app/device usage management app which is available in play store. This app will tells you how much time you have spent, unlocks, notification history, etc. This app has many feature explore it by yourself.

You can download your usage history data from the app. setting →export →export as csv

Here I am giving the link of my data.

https://www.kaggle.com/arul08/mobile-usage-dataset-individual-person?select=phone_usage.csv

This datasets consists of csv files. It consists of date, time spent, duration, app name.

Exploring the data

Lets dig the data.

I have used kaggle to explore and analysis the data. Importing the library files and the reading the files.

Reading the data sets

Cleaning the data, dropping the NaN values and renaming the columns

Converting the duration into seconds and describing the data

Duration indicated the minutes used every day. here as a cleaning process, assuming the person does not use mobile more 11hrs(660minutes) per day. if it exists 11hours then it is replaced with the median of duration

From the above information, the user unlocks the phone approximately 72 times per day and he uses phone approximately 5.5hrs(336 minutes) per day

Analysis & Plotting

this graph show the date and the phone check count

Sorry for poor plotting

Creating the new column for the day of week

Plotting the usage duration based on day of the week. 0 means Sunday, 1 means Monday…

one more new column created for the time stamp

and converting the duration into seconds using lambda function for that

Splitting the data based on the system activity and user activity

Lets find out the user’s sleeping pattern. User uses his phone till he sleeps and also unlocks the phone as first thing when he wake up. here we know the last screen lock time and also the first screen unlock time also

if the phone screen locked more than 5 hours, then the user is sleeping

The user approximately sleeps 6.7 hours every day.

since the screen off was filtered more than 5 hours. all the time are showing around 11 PM to 1 AM

if the user sleeps around 11 PM to 1 AM and his sleeping hours approximately 7 hours, then obviously he will wake up by 6 AM to 8 AM

To confirm the wake up time of the user let do some operation on the screen unlock time

This clearly shows that the user wake up around 6 AM to 8 AM. On very few days he wake up between 2 AM to 3 AM.

Now lets see the app usage history and the time spent by the user.

The above plot shows the user’s access count of the top 25 apps.

Instagram was accessed 5370 times, whatsapp 5323 times. It shows that the user spends most of his time on social media.

user spends most of his time in Instagram 17079 minutes which is 284 hours (12 days)

out of 193 days he spends 12 days in Instagram alone.

This seems very huge time, but on average he spends 1.5 hours on social media.

Create new columns for day,week,day of week, month, week of year

The above plot shows the total usage time for every week. week 20 and 48 shows low usage but there is shortage of data on those weeks.

Conclusion

  • User unlocks the phone approximately 72 times per day and he uses phone approximately 5.5 hours(336 minutes) per day.
  • On average user spends 5.5 hours per day, that means out of 193 days he spends 40 days in phone alone.
  • User uses his phone in the same pattern on all day. there is slightly high usage of his phone on Wednesday and Saturday.
  • User unlocks his phone in the same pattern on all day of week. there is slightly high unlock found on Tuesday and Saturday.
  • User approximately sleeps 6.7 hours every day and had a good sleep.
  • User sleeping time around 11 PM to 1 AM.
  • Wake up time around 6 AM to 8 AM. (On very few day user wake ups between 2 AM to 3 AM.)
  • Instagram was accessed 5370 times, whatsapp 5323 times. It shows that the user spends most of his time on social media. on average user accessed Instagram and whatsapp ~27 times/day.
  • User accessed Instagram and whatsapp on a frequency of every 45 minutes.
  • He spends most of his time in Instagram 17079 minutes which is 284 hours (12 days)
  • Out of 193 days he spends 12 days in Instagram alone. (This seems very huge time, but on average he spends 1.5 hours on social media)

Things to do for user to improve his productivity

  • User has to set the time limiter for social media apps. Currently, user spends 1.5 hours every day on social media. if he limits to 1 hour per day. then the user can save 15 hours per month.
  • User opens the social media for every 45 minutes. if the user restricts himself to open only for 2 hours, it saves time.
  • User also uses amazon kindle this shows user is a reader, so better he read hard copy books to divert himself from the phone. (Manual interpretation: user switches from kindle to YouTube, Instagram, whatsapp, this show he has distraction for that only recommending user to read hard copy books)
  • Turning off the mobile data/WiFi during the office/productive time improves user from distraction.

For more details checkout my kaggle profile.

Better I know myself, the more I can contribute to the world.

References

If you have any queries or suggestion please feel free to mention it on comment section. Thank you :)

--

--

Arul

Hi, this is Arul. Software engineer, Data analyst, psychologist. linkedin.com/in/arulrajan08/