Blog
How to Solve Python AttributeError: ‘Series’ object has no attribute ‘iterrows’
n Python, a Pandas Series is a one-dimensional labelled array capable of holding data of any type. Pandas Series is the same as a column in an Excel spreadsheet. You cannot iterate over a Series object using iterrows(). If you try to call iterrows() on a Series, you...
How to Solve Python AttributeError: ‘DataFrame’ object has no attribute ‘sort’
A DataFrame is a two-dimensional, mutable tabular data structure like an Excel spreadsheet. You can sort the columns of a DataFrame. As of version 0.20, the sort method is deprecated. If you want to sort a DataFrame, you can use DataFrame.sort_values and...
How to Solve Python AttributeError: ‘Series’ object has no attribute ‘lower’
Table of Contents Table of Contents AttributeError: 'Series' object has no attribute 'lower' Example Summary In Python, a Pandas Series is a one-dimensional labeled array capable of holding data of any type. A Pandas Series can be compared to a column in an Excel...
How to Solve Python AttributeError: ‘Series’ object has no attribute ‘strftime’
n Python, a Pandas Series is a one-dimensional labelled array capable of holding data of any type. Pandas Series is the same as a column in an Excel spreadsheet. If you have datetime objects in a Series that you want to convert to strings, you cannot use strftime()...
How to Solve Python AttributeError: ‘str’ object has no attribute ‘str’
In Python, a Pandas Series is a one-dimensional labelled array capable of holding data of any type. Pandas Series is the same as a column in an Excel spreadsheet, and the Series class has a collection of vectorized string functions under str. If you try to use one of...
How to Solve Python AttributeError: ‘Series’ object has no attribute ‘reshape’
In Python, a Pandas Series is a one-dimensional labelled array capable of holding data of any type. Pandas Series is the same as a column in an Excel spreadsheet. You cannot reshape a Pandas Series using pandas.Series.reshape. This method has been deprecated since...
How to Solve Python AttributeError: ‘str’ object has no attribute ‘contains’
If you try to call contains() on a string like string.contains(value) you will raise the AttributeError: 'str' object has no attribute 'contains'. The contains() belongs to the pandas.Series class. You can call str.contains on a Series object. To check if a substring...
What is repr() in Python?
In Python, the built-in repr() function returns a string containing a printable representation of an object. For a class object, repr() returns a string enclosed in angle brackets <> containing the name and address of the object by default This tutorial will go...
How to Solve Python AttributeError: module ‘tensorflow’ has no attribute ‘GraphDef’
In TensorFlow 2.0, tf.GraphDef is no longer in use. TensorFlow 2.0 encapsulates graph computations as Python functions instead of using Session making TensorFlow more Pythonic. If you want to continue using GraphDef in TensorFlow 2.0, use tf.compat.v1.Graphdef()...
How to Solve Python AttributeError: module ‘tensorflow.python.framework.ops’ has no attribute ‘_TensorLike’
TensorFlow 2 has integrated deep-learning Keras API as tensorflow.keras. If you try to import from the standalone Keras API with a Tensorflow 2 installed on your system, this can raise incompatibility issues, and you may raise the AttributeError: module...
Suf is a senior advisor in data science with deep expertise in Natural Language Processing, Complex Networks, and Anomaly Detection. Formerly a postdoctoral research fellow, he applied advanced physics techniques to tackle real-world, data-heavy industry challenges. Before that, he was a particle physicist at the ATLAS Experiment of the Large Hadron Collider. Now, he’s focused on bringing more fun and curiosity to the world of science and research online.