Skip to content

Instantly share code, notes, and snippets.

@nishadhka
nishadhka / ml-Python-libraries.md
Last active October 15, 2019 12:55
Python machine learning libraries in docker

Machine learning libraries of Python in Docker

The docker tar.gz'd is 2.4 GB in size, download from here

background and installed libraries in the docker

  • to set up the new ubuntu docker image, it is 124MB in size,
    sudo docker search ubuntu
    sudo docker pull ubuntu
    
@nishadhka
nishadhka / workshop_Requirements.md
Last active December 25, 2018 15:26
Docker and Jupyter notebooks-Kovaipy-Workshop Requirements

Docker and Jupyter notebooks, portal to all Python environments

Background

Docker provides operating system level virtualisation. It eases the setting up, cloning and distribution of fully functional GUI less Linux operating system. In python programming, the setting of library and distribution can be difficult in many cases if the libraries are inherently depended on OS and low level languages. This become bottle neck in learning and experimenting with Python. Docker removes this barrier by file like virtual environments of fully functional OS.

The current workshop gives an hands on training on setting up docker for major operating systems. We will be using nested virtualisation in windows OS and native application for Linux OS’s. The docker setup and consuming various data science oriented docker containers will be looked upon. After setting up the docker, we will be discussing on Jupyter notebooks, a perfect GUI for docker headless server situation.

Objectives

  1. Introduce participants about the
@nishadhka
nishadhka / nbgrep
Last active June 5, 2019 18:47 — forked from jbarratt/nbgrep
'nbgrep', search the code of all your ipython notebooks for version 3 and 4
#!/bin/bash
# usage: nbgrep 'pattern'
SEARCHPATH='/home/workingnotesBack'
# 'jq' technique lifted with gratitude
# from https://gist.github.com/mlgill/5c55253a3bc84a96addf
# Break on newlines instead of any whitespace
@nishadhka
nishadhka / Read kml into data frame using python
Created December 17, 2017 12:01
Read kml file into dataframe
from pykml import parser
import pandas as pd
filename='ref1.kml'
with open(filename) as f:
folder = parser.parse(f).getroot().Document.Folder
plnm=[]
cordi=[]
for pm in folder.Placemark:
@nishadhka
nishadhka / PandasdToFionaGeometryDictPoint.py
Last active November 21, 2017 11:45
Pandas dataframe into Fiona geometric dictionary of points
import pandas as pd
from shapely.geometry import Point, shape
from geopandas import GeoDataFrame
import fiona
from collections import OrderedDict
# a test to create shape file
df=pd.read_csv('VNP14IMGTDL_NRT_South_Asia_24h.csv')
geometry = [Point(xy) for xy in zip(df.longitude, df.latitude)]
df = GeoDataFrame(df, geometry=geometry)
@nishadhka
nishadhka / GitBranchMerge.ipynb
Created September 20, 2017 06:13
GitBranchMerge.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nishadhka
nishadhka / listToFionaGeometryDictofPolygon.py
Last active November 21, 2017 09:26
Create fiona geometry dict from the list
from shapely import geometry
ll=(84.945856,23.475927)
ue=(86.505248, 23.871591)
p1 = geometry.Point(ll[0],ll[1])
p2 = geometry.Point(ue[0],ll[1])
p3 = geometry.Point(ue[0],ue[1])
p4 = geometry.Point(ll[0],ue[1])
@nishadhka
nishadhka / rastermerege-rasterio,py
Created July 30, 2017 12:05
Raster merge using rasterio
import rasterio.merge
bounds=None
res=None
nodata=None
precision=7
def merge(input1,bounds, res, nodata, precision):
import warnings
warnings.warn("Deprecated; Use rasterio.merge instead", DeprecationWarning)
@nishadhka
nishadhka / ImageResizingPIL.ipynb
Created June 4, 2017 07:18
AccessingtheBasemapObject.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nishadhka
nishadhka / AccessBasemapObject.ipynb
Created June 3, 2017 07:44
AccessingtheBasemapObject.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.