• 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

    How Python helps outside of work: ods data to excel

    I hate copying and pasting, so might as well automate it 9:43:24 PM Trying to complete my research paper.. … The script below helped me with some research data for my Research Module (wish me good luck!) If you have any question, do ask in the comment section. See you! This allows for transforming my .ods file to .xlsx //Note --> You will have to tweak this to your needs. This is a personalised solution [sourcecode lang=”python”] #USAGE python getdata.py from pyexcel_ods import get_data import os , re, json, openpyxl, logging, typing, sys logging.basicConfig(level=logging.DEBUG, format="%(asctime)s – %(levelname)s – %(message)s") def get_rows_xy(sheet: typing.List ): ”’ argument: sheet : a multidimensional list…

Enjoy this blog? Please spread the word :)

error: Content is protected !!