by Suf | Dec 9, 2021 | Data Science, Programming, Python, Tips
Hamming distance is a type of string metric for finding how similar two binary data strings are. If the strings are equal in length, Hamming distance determines the number of bit positions different between them. We can also describe Hamming distance as the minimum...
by Suf | Dec 8, 2021 | Programming, Python, Tips
Python has several functions that are pre-defined in Python, known as built-in functions. These functions provide convenience and are very easy to use. In this tutorial, we will be looking at the abs() built-in function to calculate the absolute value of a number. As...
by Suf | Dec 6, 2021 | Programming, Python, Tips
“SyntaxError: unexpected EOF while parsing” occurs when the program finishes abruptly before executing all of the code. This error can happen when you make a structural or syntax mistake in the code, most likely a missing parenthesis or an incorrectly...
by Suf | Dec 4, 2021 | Data Science, Programming, Python, Tips
Invalid literal for int() with base 10 occurs when you try to convert an invalid object into an integer. Python is good at converting between different data types. When using the int() function, we must follow a specific set of rules. If we do not follow these rules,...
by Suf | Dec 2, 2021 | Programming, Python, Tips
Checking if a specific file exists with Python is very useful. You may want to read data in to analyse or check if a file exists before writing data to file. There are three ways to check if a file exists using the os library: isfile(), isdir(), and exists. We will...