Skip to content

Instantly share code, notes, and snippets.

View awgeezrick's full-sized avatar

Mark Jones awgeezrick

View GitHub Profile
@knu2xs
knu2xs / hashing.py
Last active April 11, 2025 08:55
Add a MD5 hash column to a Pandas data frame for change analysis.
from hashlib import md5
import pandas as pd
from typing import Optional, Iterable
def get_md5_from_series(input_iterable: Iterable) -> str:
"""
Create a MD5 hash from an Iterable, typically a row from a Pandas ``DataFrame``, but can be any
Iterable object instance such as a list, tuple or Pandas ``Series``.
Args:
import os
filename = 'homework.txt'
if not os.path.exists(filename):
with open(filename, 'w'): pass
answer1 = """1).
X | 3 | X
____|____|____
@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
import pandas as pd
if __name__ == '__main__':
# Override default pandas configuration
pd.options.display.width = 0
pd.options.display.max_rows = 10000
pd.options.display.max_info_columns = 10000
# Open example data.
df = pd.read_csv('employee_data.csv')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@discdiver
discdiver / jupyterlab_shortcuts.md
Last active May 11, 2025 10:19
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@akella
akella / setup.md
Last active May 31, 2025 01:51
My Setup
@knu2xs
knu2xs / get_dataframe.py
Last active June 28, 2023 11:46
Automatically cast a variety of inputs by introspectively detecting the data type and converting to a Spatially Enabled Dataframe
from arcgis.features import GeoAccessor, FeatureLayer
from arcgis.geometry import Geometry
from arcgis.gis import GIS
import pandas as pd
import os
import re
def get_dataframe(in_features, gis=None):
"""
// Program for cloning repos at a specific place on your computer
package main
import (
"flag"
"fmt"
"net/url"
"os"
"os/exec"
"path/filepath"