by Suf | Apr 10, 2022 | Programming, Python, Tips
The TypeError ‘bool’ object is not callable occurs when you try to call a Boolean by putting parenthesis () after it like a function. Only functions respond to function calls. This tutorial will go through the error in detail and how to solve it with the...
by Suf | Apr 10, 2022 | Programming, Python, Tips
If you want to format a datetime using datetime.strptime(), the format needs to match the original string. If there is a mismatch between the format and the original string, strptime will not be able to parse the string and will raise the ValueError: unconverted data...
by Suf | Apr 8, 2022 | Programming, Python, Tips
A DataFrame is a two-dimensional, mutable tabular data structure like an Excel spreadsheet. If you want to concatenate pandas objects using the method concat(), you must use the built-in pandas method. DataFrame does not have concat as an attribute. If you try to call...
by Suf | Apr 7, 2022 | Programming, Python, TensorFlow, Tips
The simplest way to convert a TensorFlow Tensor to a Numpy array is to use the numpy() method. For example, numpy_array = tensor.numpy(). This tutorial will go through how to convert a TensorFlow Tensor to a NumPy array for both TensorFlow 2.x and 1.x with the help of...
by Suf | Apr 6, 2022 | Programming, Python, Tips
A DataFrame is a two-dimensional, mutable tabular data structure like an Excel spreadsheet. If you want to find the unique values in a DataFrame using the method unique(), you must call the method on a Series object. If you try to call unique() on a DataFrame object,...
by Suf | Apr 5, 2022 | Programming, Python, Tips
The string accessor .str is an attribute of the Pandas Series class and provides functions to work with string data. If you try to use the .str accessor attribute on a column of a Pandas DataFrame or a Series and the values are not strings, you will raise the...