Skip to content

Instantly share code, notes, and snippets.

@ichit
ichit / organize.py
Created November 8, 2024 11:09 — forked from JesperDramsch/organize.py
Python script for organizing files in windows into multiple folders by file type. I made this primarily to organize my downloads folder.
# Author: Jacob Rust
# Modified: Jesper Dramsch
# Date: 7/8/2013
# Description:This script organizes downloaded files into separate folders depending
# on the file type. This was made for windows systems.
# Download directory should be the first command line argument
# New file types can be added to the dictionary in the main method
# Usage: python organize.py
import hashlib
@ichit
ichit / wildcards-in-paths.md
Created April 13, 2024 13:15 — forked from bennlee/wildcards-in-paths.md
What does the double asterisk(**) mean in the path?

What does the double asterisk(**) mean in the path?

There's two meaning of wildcards in paths for file collections.

  • * is a simple, non-recursive wildcard representing zero or more characters which you can use for paths and file names.
  • ** is a recursive wildcard which can only be used with paths, not file names.

For examples,

  • /var/log/** will match all files in /var/log and all files in all child directories, recursively.
  • /var/log/**/*.log will match all files whose names end in .log in /var/log and all files in all child directories, recursively.
  • /home/*/.bashrc will match all .bashrc files in all user's home directories.

This page is a curated collection of Jupyter/IPython notebooks that are notable for some reason. Feel free to add new content here, but please try to only include links to notebooks that include interesting visual or technical content; this should not simply be a dump of a Google search on every ipynb file out there.

Important contribution instructions: If you add new content, please ensure that for any notebook you link to, the link is to the rendered version using nbviewer, rather than the raw file. Simply paste the notebook URL in the nbviewer box and copy the resulting URL of the rendered version. This will make it much easier for visitors to be able to immediately access the new content.

Note that Matt Davis has conveniently written a set of bookmarklets and extensions to make it a one-click affair to load a Notebook URL into your browser of choice, directly opening into nbviewer.

@ichit
ichit / recomm_04.py
Created November 25, 2022 21:45 — forked from edunuke/recomm_04.py
# split dataset 80/20
traintest_split = model_selection.train_test_split(products_df.drop(TARGET_NAME,axis=1),
risk_df,
users_df,
y_class, test_size=0.2, random_state=SEED)
# Unpack the result in their individual parts
product_train, product_val, risk_train, risk_val, user_train, user_val, y_class_train, y_class_val, = traintest_split
@ichit
ichit / build_unet.py
Created September 13, 2022 11:30 — forked from ad-1/build_unet.py
Semantic Segmentation of MBRSC Aerial Imagery of Dubai using a TensorFlow U-Net model in Python. https://towardsdatascience.com/semantic-segmentation-of-aerial-imagery-using-u-net-in-python-552705238514
# =====================================================
# define U-Net model architecture
def build_unet(img_shape):
# input layer shape is equal to patch image size
inputs = Input(shape=img_shape)
# rescale images from (0, 255) to (0, 1)
rescale = Rescaling(scale=1. / 255, input_shape=(img_height, img_width, img_channels))(inputs)
previous_block_activation = rescale # Set aside residual