Skip to content

Instantly share code, notes, and snippets.

View mepsrajput's full-sized avatar
🎯
Focusing

Pradeep Singh mepsrajput

🎯
Focusing
View GitHub Profile
/* Proc freq with descending order */
proc freq data=Gov_C_SAS order=freq;
tables state;
run;
# Import Pandas
import pandas as pd
# Import CSV
data = pd.read_csv("../input/us-election-2020/governors_county.csv");
# Frequencies in Actual Order
datax = data['state'].value_counts().sort_index()
# Create a dataframe
@mepsrajput
mepsrajput / simple_freq_procedure.sas
Last active April 14, 2022 14:52
Simple proc freq
/* Import the CSV */
FILENAME Gov_C "/folders/myfolders/Assignments/governors_county.csv";
PROC IMPORT DATAFILE=Gov_C DBMS=CSV OUT=WORK.Gov_C_SAS;
GETNAMES=YES;
RUN;
/* freq procedure */
proc freq data=Gov_C_SAS;
@mepsrajput
mepsrajput / adruino_uno.md
Last active December 2, 2021 19:44
Adruino Uno
// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
 // initialize the LED pin as an output:
@mepsrajput
mepsrajput / dsa.md
Last active November 23, 2021 12:25

DS Flow Chart

BIG-O Cheatsheet

BIG O'S

O(1) Constant - no loops O(log N) Logarithmic - usually searching algorithms have log n if they are sorted (Binary Search) O(n) Linear - for loops, while loops through n items O(n log(n)) Log Linear - usually sorting operations O(n^2) Quadratic - every element in a collection needs to be compared to ever other element. Two nested loops O(2^n) Exponential - recursive algorithms that solves a problem of size N

@mepsrajput
mepsrajput / Dockerfile
Last active May 28, 2022 15:36
Apache Airflow / Cloud Composer
# This basically installs some dependencies, adds two SQL scripts and runs a provided SH script.
FROM apache/airflow:2.0.0-python3.7
USER root
# INSTALL TOOLS
RUN apt-get update \
&& apt-get -y install libaio-dev \
&& apt-get install postgresql-client
RUN mkdir extra
USER airflow
@mepsrajput
mepsrajput / sql.md
Last active November 11, 2020 05:25
SQL Notes

Operators in the where clause

  1. Equal (=)
  2. Greater Than (>)
  3. Less Than (<)
  4. Greater Than or Equal (>=)
  5. Less Than or Equal (<=)
  6. Not Equal (<>)
  7. BETWEEN () : Between a certain range
  8. LIKE () : Search for a pattern
@mepsrajput
mepsrajput / dppm.md
Last active September 13, 2020 08:30
Data Pre-processing Master

Data Preprocessing

In any ML process, Data Preprocessing is that step in which the data gets transformed, or Encoded, to bring it to such a state that now the machine can easily parse it.

Feature

A feature is an individual measurable property or characteristic of a phenomenon being observed. alt text

Types of Features

@mepsrajput
mepsrajput / as.md
Last active May 5, 2020 11:39
assignment
  • ACCOUNT_TABLE; Data ACCOUNT_TABLE;

    infile DATALINES delimiter=','; INPUT FirstName $ LastName $ Age Gender $;

    DATALINES; x,y,23,Male z,w,45,Female a,b,64,Male

@mepsrajput
mepsrajput / gcp.md
Last active September 12, 2020 15:53
GCP

sudo (SuperUser DO): run programs / commands with administrative privileges

apt-get

sudo apt-get update The first command you need to run in any Linux system after a fresh install. Updates the database and let your system know if there are newer packages available or not.

sudo apt-get upgrade For upgrading all the packages with available updates.