Tim Blog

Himmel oder Hölle

python data cleaning

data wrangling missing value # a list with all missing value formats missing_value_formats = ["n.a.","?","NA","n/a", "na", "--"] df = pd.read_csv("employees.csv", na_values = missing_value_formats...

python tips

error handling import traceback try: something except: traceback.print_exc() Assignment Expresions allow return value in assignment any((ret := n) % 7 == 0 for n in nums) lambda functi...

python decorator

python decorator is used in Logging, type checking, exception handling without making the functional code dirty logging def log_decorator(log_name): def log_this(function): logger = l...

python CLI

click decorator for python functions import click @click.command() # offer print help function #adding arguments option @click.option("--in", "-i", "in_file", required=True, help="Path to csv ...

python regex

regex represents regular expression, which is a character pattern in searching Sets of matching characters match for one or another character within a group, the group is defined with squre bracke...

python vaex

vaex uses lazy processing, means that read fields from file when needed most advantages when dealing with HDF5 or Apache Arrow format conversion if the original file is not in hdf we can convert i...

python spark

spark is a framework for big data calculation the biggest value addition in Pyspark is the parallel processing of a huge dataset on more than one computer All the functionalities being provided b...

tensorflow Random Forest

Random forest consists of a large number of individual decision trees that operate as an ensemble (Ensemble Learning). Each individual tree in the random forest spits out a class prediction and the...

tensorflow Nearest Neighbors

nearest neighbor by comparing the similarity between train and test data to take the most similar data’s label as test data predicted label similarity comparasion L1 distance L2...

tensorflow functions

tf.cast tf.argmax tf.argmin tf.equal tf.cast() Casts a tensor to a new type tf.cast( x, dtype, name=None ) tf.argmax() Returns the index with the largest value a...