by Suf | Jun 22, 2022 | Programming, Python, Tips
The TypeError ‘datetime.datetime’ object is not callable occurs when you try to call a datetime.datetime object by putting parenthesis () after it like a function. Only functions respond to function calls. This error commonly occurs when you override the...
by Suf | Jun 22, 2022 | Programming, Python, Tips
This error occurs when you try to call the items() method on a string instead of a Python dictionary. If you have a JSON string, you can parse the string to a dictionary using the json.loads() method. For example, import json my_dict =...
by Suf | Jun 22, 2022 | Programming, Python, Tips
The error occurs when you try to parse an invalid JSON string to the json.loads() method call. You can solve this error by ensuring you escape double quotes with double backslashes. For example, import json data = json.loads( ‘{ “particle”:{...
by Suf | Jun 21, 2022 | Programming, Python, Tips
The TypeError ‘Series’ object is not callable occurs when you try to call a Series object by putting parentheses () after it like a function. Only functions respond to function calls. You can solve this error by using square brackets to access values in a...
by Suf | Jun 21, 2022 | Programming, Python, Tips
This error occurs when you try to iterate over a function object, for example, using a for loop. If your function returns an iterable object, you can solve the error by adding parentheses () after the function name to call it and return the object. For example, def...
by Suf | Jun 21, 2022 | Programming, R, Tips
This error occurs when you try to fit a model, and one or more of the variables is a list instead of a vector. You can solve this error by converting the list to a vector using the unlist() function. For example, x <- list(2, 5, 5, 6, 7, 11, 2, 3, 5) y <- c(4,...