Skip to content

Instantly share code, notes, and snippets.

View innat's full-sized avatar
:octocat:
Working from home

Mohammed Innat innat

:octocat:
Working from home
View GitHub Profile
@innat
innat / DotMultiply.md
Last active September 6, 2024 21:38
In Python np.dot and np.multiply with np.sum
@innat
innat / FilterMap.md
Last active November 24, 2018 15:50
Python: Difference between filter(function, sequence) and map(function, sequence)

map and filter function in python is pretty different because they perform very differently. Let's have a quick example to differentiate them.

map function

Let's define a function which will take a string argument and check whether it presents in vowel letter sequences.

def lit(word):
    return word in 'aeiou'

Now let's create a map function for this and pass some random string.

@innat
innat / ImageCenter.md
Created November 11, 2018 23:05
Center Images in GitHub README.md

For left alignment

 <img align="left" width="600" height="200" src="https://www.python.org/python-.png">

For right alignment

<img align="right" width="600" height="200" src="https://www.python.org/python-.png">

And for center alignment

@innat
innat / Delete Key.md
Last active November 24, 2018 15:51
Removing Key from Python Dictionary.

We can delete a key from a Python dictionary by the some following approaches.

Using the del keyword; it's almost the same approach like you did though -

     myDict = {'one': 100, 'two': 200, 'three': 300 }
     print(myDict)  # {'one': 100, 'two': 200, 'three': 300}
     if myDict.get('one') : del myDict['one']
     print(myDict)  # {'two': 200, 'three': 300}
@innat
innat / NumPad.md
Last active November 24, 2018 15:51
Explaining Padding using NumPy

NumPy 1.7 (when np.pad was added) is pretty old now (it was released in 2013) so even though the question asked for a way without that function I thought it could be useful to know how that could be achieved using np.pad.

It's actually pretty simple:

>>> import numpy as np
>>> a = np.array([[ 1.,  1.,  1.,  1.,  1.],
...               [ 1.,  1.,  1.,  1.,  1.],
...               [ 1.,  1.,  1.,  1.,  1.]])
>>> np.pad(a, [(0, 1), (0, 1)], mode='constant')

array([[ 1., 1., 1., 1., 1., 0.],

Some GitHub Extensions that I use. They may also enable you to improve your productivity on GitHub.

  1. Octotree allows easy exploration of the source code within the browser through a panel on the left.

chrome-github

2 github-dashboard provides the ability to filter events on the Github.com activity dashboard.

i

@innat
innat / Notebook Image Inclusion.md
Last active November 24, 2018 15:52
Include image or picture in jupyter notebook.

Problem Space

How to Include image or picture in jupyter notebook?

Method 1: Markdown Cell

Run like following on markdown cell,

![title]()

@innat
innat / Jekyll_Customize.md
Last active August 16, 2018 17:49
Jekyll is Love

Render Mathematical Equation on GitHub Page

Stack QA

Magic of MathJax.

Procedure

  1. Add following piece of code to jekyll _includes folder, we can name it mathjax.html
@innat
innat / Floyd_Cloud Set Up.md
Last active July 2, 2018 05:25
environment setup for floyd cloud

Login - Initialize - Run

Sign Up first

Optionally we can do all things to create a conda environment.

Login

  1. local installation using 'pip install -U floyd-cli'
  2. floyd login -u <user_name>