Skip to content

Instantly share code, notes, and snippets.

View mjimcua's full-sized avatar

Miguel Angel Jiménez Cuadrillero mjimcua

View GitHub Profile
@mjimcua
mjimcua / logging.py
Created March 17, 2022 09:59 — forked from joshbode/logging.py
Colour Logging - Works in Jupyter Lab/Notebook
import sys
import logging
from typing import Optional, Dict
from colorama import Fore, Back, Style
class ColoredFormatter(logging.Formatter):
"""Colored log formatter."""
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import missingno
import warnings
warnings.filterwarnings("ignore")
%matplotlib inline
@mjimcua
mjimcua / spark_wc_windows_pycharm_example.py
Created July 31, 2018 12:33 — forked from moutai/spark_wc_windows_pycharm_example.py
How to enable Apache Spark in PyCharm on windows, with pre-built binaries from Spark downloads,adopted from http://www.abisen.com/spark-from-ipython-notebook.html and https://gist.github.com/bigaidream/40fe0f8267a80e7c9cf8
import sys
import os
from operator import add
# Set the path for spark installation
# this is the path where you downloaded and uncompressed the Spark download
# Using forward slashes on windows, \\ should work too.
os.environ['SPARK_HOME'] = "C:/spark/spark-1.2.1-bin-hadoop2.4/"
# Append the python dir to PYTHONPATH so that pyspark could be found
sys.path.append("C:/spark/spark-1.2.1-bin-hadoop2.4/python")