programming notes
Open main menu
Data Engineering
Data Visualization
Machine Learning
Code Snippets
About
Code Snippets
Code Snippets for Data Engineering, Data Science, Probability, and Machine Learning and More
R Programming
Train Test Split with Base R
Python
List Comprehension
Defining a Class
List Comprehension with If and Else Statement
Dictionary Comprehension
Sorting Dictionary by Value
Tuple unpacking with *variable notation
Dictionary Unpacking with *args
Unix
Read file line by line
find and replace with sed
Simple Arithmetic with bc
History with last n commands
Recursive Grep by file type
Pandas
Sorting Dataframe By Value
Sorting Dataframe By Multiple Values
Sorting Dataframe By Row Index
Sorting Dataframe By Column Index
Pandas Apply Row Level
Pandas Apply Using Lambda Expression
Pandas Groupby Text Group Concat
Pandas Groupby Aggregation Multiple Compute Functions
Pandas Groupby with Different Aggregation Functions
Splitting a Column to Multiple Columns
Pandas Series Frequency Value Counts
Filter Dataframe by Column Frequency with value counts
C++
Enum User Defined Type
Iterating an array with range
Switch Statements
Struct User Defined Data Types
Simple Class Methods with Struct
Classes with class keyword and Access Controls
Random Number from a Range
Reading from a file with fstream
Writing to file with ofstream
Convert string user input to int with sstream
Command Line Tools
find and replace with sed
History with last n commands
Recursive Grep by file type
grep matching
Create multiple subdirectories
Simple Arithmetic with bc
Distance Metrics
Euclidean Distance
Cosine Similarity
Minkowski Distance