Month: January 2021

How to Remove a Non-Empty Folder in Python?

Problem Formulation: Given a path to a folder as a Python string. The folder is non-empty. How to remove the whole folder in your Python script? Example: Say, you have the path=’path/to/folder’ in your Python script and it contains some files and subfolders: path –to —-folder ——file1.dat ——file2.dat ——subfolder1 ——–file3.dat ——subfolder2 ——–file4.dat You want to …

How to Remove a Non-Empty Folder in Python? Read More »

How to Fix “TypeError: len() of unsized object”

Problem Formulation: How to fix the TypeError: len() of unsized object? TypeError: len() of unsized object There are many possible ways why this array may occur. One common pitfall is to use the len() function on a NumPy array with only one value. Example: Let’s consider the minimal example that creates this error message! Reason …

How to Fix “TypeError: len() of unsized object” Read More »

How to Install Pandas on PyCharm?

Problem Formulation: Given a PyCharm project. How to install the pandas library in your project within a virtual environment or globally? Solution that always works: Open File > Settings > Project from the PyCharm menu. Select your current project. Click the Python Interpreter tab within your project tab. Click the small + symbol to add …

How to Install Pandas on PyCharm? Read More »

TensorFlow — A Helpful Illustrated Guide

Machine Learning (ML) is a sought-after skill in today’s automated world. Google is one of the key players in the Machine Learning space. With the growing scale and popularity of deep learning, the limitations of a single machine become more and more pronounced. Motivation Training a model on a single computer can take a long …

TensorFlow — A Helpful Illustrated Guide Read More »

MapReduce — A Helpful Illustrated Guide

MapReduce is the name of both (i) a distributed processing programming model provided by the Apache Foundation, and (ii) a functional processing technique. It consists of two steps: the map() function and the reduce() function. Map() converts each element in a data set into a modified element. Reduce() takes subsets of modified elements and aggregates …

MapReduce — A Helpful Illustrated Guide Read More »