Original Database

$ sudo -u root -p

mysql> show databases;

mysql> use home;

mysql> show tables;

mysql> SELECT * FROM people;

getdata.php

Create a PHP file in the /var/www/html/ folder and write some code in it. Run this file in the localhost.

$ sudo touch[space here]/var/www/html/getdata.php


A step by step guide to create a very basic dynamic web page. I am using Ubuntu 16.04 machine.

This article in a nutshell:

  1. Download prerequisites

2. Start the web server

3. Create a new MySQL database with table and columns

4. Create an HTML form to collect data.

5. Create a PHP file to connect to the database that will accept the submitted form data and add it to the database.

6. Run the HTML form file on the web server, add user data and check if the database is populated.

First-up is the environment setup:

Code editor (A developer’s code editor is a…


I have struggled a lot in understanding how Git and Github works. Recently I came across the freecodecamp git and github crash course on YouTube. I highly recommend it! After watching this course, I have made some notes of git commands that I will be using on my local Ubuntu machine. They are used to push python code from my local PyCharm IDE to remote Github website. Prior to these commands you will have to install git on your local machine and generate the SSH keys and add them to SSH agent. I would recommend docs.github.com to do this.

  1. Open…

Photo by Markus Spiske on Unsplash

One of the main challenge while doing data analysis using Covid-19 Cases and Deaths data, was to merge these two data-frames together on dates. Because of duplicate date entries in each of the CSV data files, merging the two data-frames was not straightforward. Here’s the explanation of how I got around this challenge.

1. Data Download- Cases.csv

I have already downloaded and saved the cases.csv file from coronovirus.data.gov.uk into my Kaggle webpage. Here is a quick glance at this data.


The most important thing that I have learned from this mini project is that:

Understand how data is structured.

I am using Covid19 UK data downloaded as a CSV file from data.gov.uk website. This data is related to cases by date.

  1. Initial imports

import pandas as pd # data processing, CSV file (e.g. pd.read_csv)

import numpy as np # for maths calculations

%matplotlib inline #to plot line graphs

2. Data download.

I have downloaded this data into my Kaggle account. Here I am accessing this downloaded data from my Kaggle account. …


I have been learning about file handling in Python this week. Here are some notes on basic file handling code as beginner.

So lets CREATE, READ, UPDATE and DELETE files in Python.

1.READ

To read a text file we use the open() function. This function takes two arguments, filename and the mode. ‘helloworld.txt’ is our filename and since we are reading a file we are using the mode ‘r’. Please note that ‘r’ will give an error if the file does not exist in the folder. I have already manually created a text file named ‘helloworld.txt’ …


It was a long-winded process for me as a newbie when I tried to install python 3.8 on my computer. I am sharing my experience about what worked while installing, changing default versions and fixing the terminal that temporarily stopped working.

How to install Python 3.8 on Ubuntu 16.04?

Step 1: APT automates the retrieval, configuration and installation of software packages. Type these two commands in your terminal and hit enter each time.

sudo apt updatesudo apt install software-properties-common

Step 2: PPA (Personal Package Archive) are used to add a software to your Ubuntu. They cut down on time taken to install the software from the original…


I have created a set of commands that I always refer to, when I am doing data analysis. I hope these commands help you to get started especially if you are a beginner.

Data-frame creation

Using Jupyter notebooks, I am importing pandas module and creating a very small data-frame called ‘books’ by adding data using a python dictionary and a list.

import pandas as pd books = { 
'Name': ['Harry Potter','Matilda','Gangsta Granny','The Horse and His Boy'],
'Author':['J K Rowling','Ronald Dahl','David Williams','C S Lewis'],
'Cost':[10.99, 8.99, 12.50, 11.99]
}
df = pd.DataFrame(books)
df
This is our original data frame to work on.

Columns

  1. How to view column names?
df.columns


Photo by Jeremy Bishop on Unsplash

If you are a beginner and have never studied programming languages before, my easy to follow guide will help you to understand the basics of Python programming. Lets get started!

1.Writing your first computer program

print("Hello World")Output:
Hello World

2. Understanding Variable and Variable assignment

x is a variable that holds (i.e. is assigned) the value 5.

x = 5
print(x)
Output:
5

3. Understanding Indexing

In Python all data begins with index position 0. If you want to access the data, you must specify the index number.

RL

I am learning computer science and sharing my revision notes on this page.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store