One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
import pandas as pd | |
d = {'dat': ['2016-01-01', '2016-01-02', '2016-01-03', '2017-01-01', '2017-01-02', '2017-01-03'],'x': [1, 2, 3, 4, 5, 6]} | |
df1 = pd.DataFrame(d) | |
df1.set_index(['dat'], inplace=True) | |
df1.index = pd.to_datetime(df1.index) | |
d = {'dat': ['2016-01-01', '2017-01-01'],'y': [10, 11]} | |
df2 = pd.DataFrame(d) | |
df2.set_index(['dat'], inplace=True) |
for f in `ls *.eps`; do | |
convert -density 100 $f -flatten ${f%.*}.png; | |
done | |
ping -c 3 10.9.8.7 | |
PING 10.9.8.7 (10.9.8.7) 56(84) bytes of data. | |
From 10.9.8.1 icmp_seq=1 Destination Host Unreachable | |
From 10.9.8.1 icmp_seq=2 Destination Host Unreachable | |
From 10.9.8.1 icmp_seq=3 Destination Host Unreachable | |
--- 10.9.8.7 ping statistics --- | |
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2048ms | |
pipe 3 |
#! /bin/bash | |
# this script will create new user accounts | |
# enforce execution with a root priviledges, | |
# return status 1 if not root | |
if [[ "${UID}" -eq 0 ]] | |
then | |
# enter the username (login), |
#!/bin/bash | |
# Make sure the script is being executed with superuser privileges. | |
if [[ "${EUID}" -ne 0 ]]; then | |
echo 'The script requires root priveledges' | |
exit 1 | |
fi | |
# supply at least one argument otherwise return an exit status of 1 | |
if [[ "${#}" -lt 1 ]] |
Bootstrap: docker | |
From: openjdk:17 | |
%arguments | |
NETLOGO_VERSION=6.3.0 | |
%setup | |
# Download Netlogo on host if not already present | |
wget -nc https://ccl.northwestern.edu/netlogo/{{NETLOGO_VERSION}}/NetLogo-{{NETLOGO_VERSION}}-64.tgz |
""" | |
Purpose: this script creates GitHub gists for all files in a directory. | |
Adapted from | |
https://jels-boulangier.medium.com/automatically-create-github-gists-for-your-medium-articles-ba689775b032 | |
Usage: python create_gists.py <directory> | |
""" | |
import subprocess | |
import sys | |
from pathlib import Path |
#!/bin/bash | |
sudo apptainer build netlogo-headless.sif netlogo-headless.def |