Skip to content

Instantly share code, notes, and snippets.

@ronakmutha
ronakmutha / docker_clone_volume.sh
Created December 23, 2020 04:28
Shell script to clone docker volumes
#!/bin/bash
#Script that can clone a given volume
#Verify user entered arguments
if [ "$1" = "" ]
then
echo "Provide a source volume name that needs to be cloned"
exit
fi
@ronakmutha
ronakmutha / makemigrations.py
Created November 30, 2020 06:42
Fix Django migration conflicts by Migration Manifest
from django.core.management.commands.makemigrations import Command as BaseCommand
from django.db.migrations.loader import MigrationLoader
class Command(BaseCommand):
def handle(self, *app_labels, **options):
# Creates a manifest file with stores the last migrations
# for each of the Django app.
super(Command, self).handle(*app_labels, **options)
>>> df.dropna()
>>> df.isnull().sum()
>>> df.isnull()
>>> df.eval("batch=batch.str[0]")
>>> df['batch'] = df['batch'].str[0]
>>> df["url_len"] = df["url"].map(len)
>>> df.sort_values([colname_1,colname_2],ascending=[True,False])
>>> for i, row in df.iterrows():
print("Index {0}".format(i))
print("Row {0}".format(row))