• Coding

    python: Creating a simple bar plot with python, matplotlib module and csv data

    This is so simple, it needs no heading.. 08/19/201810:10:49 PM Drinks Coffee as usual… Straight to the point: So this is the CSV data I will be working with ( generated using the website: https://mockaroo.com) MOCK_DATA Goal: Create a bar plot showing  the number of emails based on the alphabets they begin with . For instance, how many emails begin with “a” etc… This can be useful for visualizing emails from various email providers (e.g. yahoo, gmail, etc..).   [sourcecode lang=”python”] import csv, matplotlib.pyplot as plt, numpy as np filename = "MOCK_DATA.csv" def count_email(rows): dictionary = {} for row in rows: email = row[3] if email[0] not in dictionary: dictionary[email[0]] =…

  • Coding

    Automate Simple Tasks with Python: Excel Table to HTML Table using the python Dominate Module

    Book Sometimes a database is really not necessary. Why not try a simple excel sheet Coded this in an hour; sips on coffee though 9:06:34 PM I generated the excel workbook using a website called Mockaroo. Today’s task is to convert a basic excel sheet table into an HTML table. I broke the task into sub tasks which were then later translated into functions.   Do you need a website ? I can build it for you! PseudoCode Convert Excel Table into one dimensional List containing dictionaries Convert List into HTML document Save HTML string into a file with “.html” extension Done The Excel Sheet looked like this: MOCK_DATA The code generated…

error: Content is protected !!