Skip to content

Instantly share code, notes, and snippets.

View biplab37's full-sized avatar
🌳
Finding Beauty in Dissonance

Biplab Mahato biplab37

🌳
Finding Beauty in Dissonance
View GitHub Profile

Numerical Derivative

In python

Using finite Difference

import numpy as np

def deriv(x,y):
  return np.diff(y)/np.diff(x)
@biplab37
biplab37 / Makefile.md
Last active August 4, 2020 07:05
Makefile

How to create a Makefile

Sometime in a project to run or build it you need to run multiple commands depending on the files that are present. This sometime is cumbersome and typing the same long command again and again is tedious. Having a Makefile can save the day. You can save your code in a makefile and then just type make in the terminal to run it.

Content of the file

Content in the makefile is very simple. The basic structure is

target: dependencies
   command
  • target This is the file that will be changed.
@biplab37
biplab37 / matplotlib.md
Created April 26, 2020 05:21
3d plot matplotlib

3D plot in matplotlib


import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

data = np.loadtxt("data.dat")
@biplab37
biplab37 / gnuplot.md
Last active April 26, 2020 05:22
Creating Plots

Plotting in Gnuplot


Suppose you want to plot your data in the file name 'data.dat' and fit it with linear regression then add the code below in a file say 'plot.gnuplot'

	#!/usr/bin/gnuplot
	set terminal png
	set output 'image.png'

	set title 'Plot' font 'Hack,12'
@biplab37
biplab37 / markdown_cheatsheet.md
Last active April 23, 2020 16:30
Github Markdown Cheatsheet

Markdown Cheat Sheet


Basic Text

Text can be added like normal editing. You can add bold text by typing two asterix signs around the text to be bolden and italics by underscores around it.

this text is in bold this one is in italics