by Suf | Apr 27, 2022 | Programming, Python, Tips
You can concatenate multiple Series or DataFrames using the pandas.concat() method. If you pass the multiple DataFrames to the concat method without using square brackets, you will raise the TypeError: first argument must be an iterable of pandas objects, you passed...
by Suf | Apr 26, 2022 | Pandas, Programming, Python, Tips
You can only plot numeric data when using Pandas. If you try to plot with non-numeric data, the Python interpreter will raise the TypeError: no numeric data to plot. This error typically occurs when you have strings representing numbers in your DataFrame. To solve...
by Suf | Apr 24, 2022 | Programming, Python, Tips
If you try to reference a local variable before assigning a value to it within the body of a function, you will encounter the UnboundLocalError: local variable referenced before assignment. The preferable way to solve this error is to pass parameters to your function,...
by Suf | Apr 24, 2022 | Programming, Python, Tips
If you try to parse invalid JSON or decode an empty string as JSON, you will encounter the JSONDecodeError: Expecting value: line 1 column 1 (char 0). This error can occur if you read an empty file using json.load, read an empty JSON or receive an empty response from...
by Suf | Apr 23, 2022 | Programming, Python, Tips
The min() function is built into Python and returns the item with the smallest value in an iterable or the item with the smallest value from two or more objects of the same type. When you pass an iterable to the min() function, such as a list, it must have at least...
by Suf | Apr 22, 2022 | Programming, Python, Tips
In Python, bool is the type for the Boolean object, which is an object that represents one of two values: True or False. You cannot retrieve items from a Boolean value using the subscript operator [] like you can with a list or a tuple. If you try to use the subscript...