ItsMyCode
  • How To
  • Python
    • Basics
    • Advanced
    • Built-In Methods
    • Dictionary Methods
    • String Methods
    • List Methods
    • Date and Time
    • Files and Folders
    • Matplotlib
    • Seaborn
    • NumPy
    • Pandas
    • SciPy
    • Errors and Exception
    • Django
  • R
  • Git
  • Powershell
  • Javascript
  • C#
    • Sitecore
  • Node.js
ItsMyCode

Coding Simplified

  • How To
  • Python
    • Basics
    • Advanced
    • Built-In Methods
    • Dictionary Methods
    • String Methods
    • List Methods
    • Date and Time
    • Files and Folders
    • Matplotlib
    • Seaborn
    • NumPy
    • Pandas
    • SciPy
    • Errors and Exception
    • Django
  • R
  • Git
  • Powershell
  • Javascript
  • C#
    • Sitecore
  • Node.js
541
98
0

Home » Python » Page 2

Browsing Category

Python

221 posts

Python is a widely used, high-level programming language. Python tutorial and articles will help you learn Python with a help of high quality examples.

Subcategories
  • Advanced
  • Basics
  • Built-In Methods
  • Date and Time
  • Dictionary Methods
  • Django
  • Errors and Exception
  • Files and Folders
  • List Methods
  • NumPy
  • Pandas
  • SciPy
  • Seaborn
  • String Methods
Python List Index()
  • Python
  • List Methods
  • 2 minute read

Python List index()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The Python list index() is a built-in function that searches for a given element from the start of the list and returns the lowest index where the element appears in…
View Post
Error: Command Errored Out With Exit Status 1: Python Setup.py Egg_Info Check The Logs For Full Command Output
  • Python
  • Errors and Exception
  • 2 minute read

[Solved] Error: command errored out with exit status 1

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If you are installing auto-py-to-exe package on Python 3.8 or below, you will get an error stating ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full…
View Post
Importerror: Cannot Import Name 'Json' From Itsdangerousom Itsdangerous
  • Python
  • Errors and Exception
  • 2 minute read

[Solved] ImportError: cannot import name ‘json’ from itsdangerous

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If you are deploying and running the flask application(1.1.2) using the Docker containers, you will get ImportError: cannot import name ‘json’ from itsdangerous In this article, we will look at what…
View Post
Error In Plot.new() : Figure Margins Too Large
  • Python
  • Errors and Exception
  • 2 minute read

[Solved] Error in plot.new() : figure margins too large

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The error in plot.new() : figure margins too large occur if the plot panel in the RStudio is too small for the margins you are trying to create. In this…
View Post
Python Was Not Found; Run Without Arguments To Install From The Microsoft Store, Or Disable This Shortcut From Settings ≫ Manage App Execution Aliases.
  • Python
  • Errors and Exception
  • 3 minute read

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If you have not installed Python on your windows machine or if the path environment variables are not set properly in windows you will get Python was not found error.…
View Post
Attributeerror: Can Only Use .Str Accessor With String Values
  • Python
  • Errors and Exception
  • 2 minute read

AttributeError: Can only use .str accessor with string values

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas occurs if you try to replace the values of string column, but in reality,…
View Post
Typeerror: Method() Takes 1 Positional Argument But 2 Were Given
  • Python
  • Errors and Exception
  • 3 minute read

TypeError: method() takes 1 positional argument but 2 were given

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If you define a method inside a class, you should add self as the first argument. If you forget the self argument, then Python will raise TypeError: method() takes 1 positional…
View Post
Importerror No Module Named Matplotlib.pyplot
  • Python
  • Errors and Exception
  • 2 minute read

[Solved] ImportError: No module named matplotlib.pyplot

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The ImportError: No module named matplotlib.pyplot occurs if you have not installed the Matplotlib library in Python and trying to run the script which has matplotlib related code. Another issue…
View Post
Typeerror: 'Float' Object Is Not Callable
  • Python
  • Errors and Exception
  • 3 minute read

Python TypeError: ‘float’ object is not callable

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The TypeError: ‘float’ object is not callable error occurs if you call floating-point value as a function or if an arithmetic operator is missed while performing the calculations or the reserved…
View Post
Typeerror 'Builtin_Function_Or_Method' Object Is Not Subscriptable
  • Python
  • Errors and Exception
  • 2 minute read

TypeError: ‘builtin_function_or_method’ object is not subscriptable

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python, Built-in functions are not subscriptable, if we use the built-in functions as an array to perform operations such as indexing, you will encounter TypeError: ‘builtin_function_or_method’ object is not subscriptable.…
View Post
Typeerror Can Only Concatenate Str (Not Int) To Str
  • Python
  • Errors and Exception
  • 2 minute read

TypeError: can only concatenate str (not “int”) to str

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python, we can concatenate values if they are of the same type. Let’s say if you concatenate a string and an integer you will get TypeError: can only concatenate…
View Post
Typeerror: Only Size-1 Arrays Can Be Converted To Python Scalars
  • Python
  • Errors and Exception
  • 3 minute read

TypeError: only size-1 arrays can be converted to python scalars

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
We get this error generally while working with NumPy and Matplotlib. If you have a function that accepts a single value, but if you pass an array instead, you will…
View Post
How To Install Seaborn In Python Using The Pip Command
  • Python
  • Seaborn
  • 1 minute read

How to Install Seaborn in Python using the Pip command

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • January 31, 2022
This tutorial will learn how to install Seaborn in Python using the Pip command. Seaborn is a library for making statistical graphics in Python. It is built on top of matplotlib…
View Post
We Get Attributeerror: Module 'Pandas' Has No Attribute 'Dataframe'
  • Python
  • Errors and Exception
  • Pandas
  • 3 minute read

How to Fix: module ‘pandas’ has no attribute ‘dataframe’

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
We get AttributeError: module ‘pandas’ has no attribute ‘dataframe’ when the Pandas module is unable to resolve and initialize the DataFrame class. The AttributeError usually occurs if the class is not…
View Post
How To Add A Title To Seaborn Plots
  • Python
  • Seaborn
  • 2 minute read

How to Add a Title to Seaborn Plots

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • January 31, 2022
There are four different methods to add a title to seaborn plots. Let us explore each of these methods in detail with examples. Method 1: Using set() method The set()…
View Post
How To Create A Pie Chart In Seaborn
  • Python
  • Seaborn
  • 2 minute read

How to Create a Pie Chart in Seaborn

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • January 31, 2022
We do not have any built-in function to create Pie chart in seaborn, but with the help of Matplotlib, we can create a pie chart and leverage seaborn for color…
View Post
Permissionerror [Errno 13] Permission Denied
  • Python
  • Errors and Exception
  • 3 minute read

Python PermissionError: [Errno 13] Permission denied

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If we provide a folder path instead of a file path while reading file or if Python does not have the required permission to perform file operations(open, read, write), you…
View Post
Calculate Euclidean Distance In Python
  • Python
  • SciPy
  • 2 minute read

Calculate Euclidean Distance in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this article, we will be using the NumPy and SciPy modules to Calculate Euclidean Distance in Python. In mathematics, the Euclidean Distance refers to the distance between two points…
View Post
Python Print Variable
  • Python
  • Basics
  • 4 minute read

Python Print Variable

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Python is one of the most versatile programming languages, and we can use the print statement in several ways to print a variable in Python. In this article, let us…
View Post
Adding New Column To Existing Dataframe In Pandas
  • Python
  • Pandas
  • 4 minute read

Adding new column to existing DataFrame in Pandas

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this article, we will look at different ways to adding new column to existing DataFrame in Pandas.  Let us create a simple DataFrame that we will use as a…
View Post
Python String Rstrip()
  • Python
  • String Methods
  • 2 minute read

Python String rstrip()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String rstrip() method is a built-in function that strips trailing characters based on the arguments passed to the function and returns the copy of a string. Syntax The…
View Post
Python String Lstrip()
  • Python
  • String Methods
  • 2 minute read

Python String lstrip()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String lstrip() method is a built-in function that strips leading characters based on the arguments passed to the function and returns the copy of a string. Syntax The…
View Post
Python String Strip()
  • Python
  • String Methods
  • 2 minute read

Python String strip()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String strip() method is a built-in function that strips both leading and trailing characters based on the arguments passed to the function and returns the copy of a…
View Post
Python String Split()
  • Python
  • String Methods
  • 2 minute read

Python String split()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String split() method is a built-in function that splits the string based on the specified separator and returns a list of strings. Syntax The Syntax of split() method is: str.split(separator,…
View Post
Python String Rsplit()
  • Python
  • String Methods
  • 2 minute read

Python String rsplit()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String rsplit() method is a built-in function that splits the string at the specified separator from the right side and returns a list of strings. Syntax The Syntax…
View Post
Python String Title()
  • Python
  • String Methods
  • 1 minute read

Python String title()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String title() method is a built-in function that returns a string where the first character of each word is uppercase. It is also called a title case string.…
View Post
Python String Zfill()
  • Python
  • String Methods
  • 1 minute read

Python String zfill()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String zfill() method is a built-in function that adds zeros (0) at the beginning of the string until it reaches the specified length and returns the copy of…
View Post
Python String Isdecimal()
  • Python
  • String Methods
  • 1 minute read

Python String isdecimal()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String isdecimal() method is a built-in function that returns true if all the characters in a string are decimal. If one of the characters is not decimal in…
View Post
Python String Rfind()
  • Python
  • String Methods
  • 2 minute read

Python String rfind()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String rfind() method is a built-in function that returns the substring’s highest index (last occurrence) in a given string. If not found, it returns -1. Syntax The Syntax…
View Post
Python String Isidentifier()
  • Python
  • String Methods
  • 1 minute read

Python String isidentifier()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String isidentifier() method is a built-in function that returns true if the string is a valid identifier. If not it returns False. Syntax The Syntax of isidentifier() method is: string.isidentifier()…
View Post
Python String Isprintable()
  • Python
  • String Methods
  • 2 minute read

Python String isprintable()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String isprintable() method is a built-in function that returns true if all the characters in a string are printable or if the string is empty. If not, it…
View Post
Python String Find()
  • Python
  • String Methods
  • 2 minute read

Python String find()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String find() method is a built-in function that returns the index of the first occurrence of a substring in a given string. If not found, it returns -1.…
View Post
Python String Rindex()
  • Python
  • String Methods
  • 2 minute read

Python String rindex()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String rindex() method is a built-in function that returns the substring’s highest index (last occurrence) in a given string. If not found, it raises ValueError: substring not found…
View Post
Python String Index()
  • Python
  • String Methods
  • 2 minute read

Python String index()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
The Python String index() method is a built-in function that returns the substring’s lowest index (first occurrence) in a given string. If not found, it raises ValueError: substring not found…
View Post
How To Find Unique Values Of A Column In Pandas
  • Python
  • Pandas
  • 2 minute read

Pandas : How to Find Unique Values in a Column

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
We can find unique values of a column in Pandas DataFrame using the unique() function. The unique() method filters out only unique values from a dataframe column. In this tutorial,…
View Post
Typeerror 'Numpy.float64' Object Cannot Be Interpreted As An Integer
  • Python
  • Errors and Exception
  • 2 minute read

TypeError: ‘numpy.float64’ object cannot be interpreted as an integer

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The TypeError: ‘numpy.float64’ object cannot be interpreted as an integer occurs if you pass a float value to a function like range() which accepts only integer. In this tutorial, let us look…
View Post
How To Rename Columns In Pandas Dataframe
  • Python
  • Pandas
  • 2 minute read

How to rename columns in Pandas DataFrame

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
 Pandas is a useful library in data analysis, and Pandas DataFrame is Two-dimensional, size-mutable, potentially heterogeneous tabular data. In this tutorial, let’s see how to rename columns in Pandas DataFrame. There are…
View Post
Attributeerror 'Numpy.ndarray' Object Has No Attribute 'Index'
  • Python
  • Errors and Exception
  • 3 minute read

AttributeError: ‘numpy.ndarray’ object has no attribute ‘index’

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The AttributeError: ‘numpy.ndarray’ object has no attribute ‘index’ occurs when you attempt to use the index() method on a NumPy array that does not have any index attribute to use.…
View Post
[Solved] Pandas Typeerror No Numeric Data To Plot
  • Python
  • Errors and Exception
  • Pandas
  • 3 minute read

[Solved] Pandas TypeError: no numeric data to plot

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Pandas, we can only plot values with the numeric data type. If you try to plot with any other Data Type other than numeric data, Python will raise TypeError: no…
View Post
How To Fix In Python Valueerror Trailing Data
  • Python
  • Errors and Exception
  • Pandas
  • 2 minute read

How to Fix in Python ValueError: Trailing data?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python ValueError: Trailing data occurs when you try to load the JSON data or file into pandas DataFrame, and the data is written in lines separated with newline characters…
View Post
How To Fix Keyerror In Pandas
  • Python
  • Errors and Exception
  • Pandas
  • 2 minute read

How to Fix: KeyError in Pandas?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The KeyError in Pandas occurs when you try to access the columns in pandas DataFrame, which does not exist, or you misspell them.  Typically, we import data from the excel…
View Post
Nameerror Name 'Pd' Is Not Defined
  • Python
  • Errors and Exception
  • 3 minute read

[Solved] NameError: name ‘pd’ is not defined

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python,  NameError: name ‘pd’ is not defined occurs when you import the pandas library but fail to provide the alias as pd while importing it. In this article, let us look…
View Post
Nameerror Name ''Np'' Is Not Defined
  • Python
  • Errors and Exception
  • 2 minute read

[Solved] NameError: name ‘np’ is not defined

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python,  NameError: name ‘np’ is not defined occurs when you import the NumPy library but fail to provide the alias as np while importing it. In this article, let…
View Post
Valueerror If Using All Scalar Values, You Must Pass An Index
  • Python
  • Errors and Exception
  • 2 minute read

ValueError: If using all scalar values, you must pass an index

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If you pass all scalar values while creating pandas Dataframe in Python, you will encounter “ValueError: If using all scalar values, you must pass an index“ In this tutorial, we…
View Post
No Handles With Labels Found To Put In Legend
  • Python
  • Errors and Exception
  • 2 minute read

No handles with labels found to put in legend

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python matplotlib No handles with labels found to put in legend occur if you have not defined the label parameters whenever you plot the figure and try to call…
View Post
Typeerror Can’t Multiply Sequence By Non-Int Of Type ‘Str’
  • Python
  • Errors and Exception
  • 3 minute read

[Solved] Python can’t Multiply Sequence by non-int of type ‘str’

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The TypeError: can’t multiply sequence by non-int of type ‘str’ occurs if we multiply a string by another string without converting into an integer or floating-point. In this tutorial, we…
View Post
Typeerror List Indices Must Be Integers Or Slices, Not Str
  • Python
  • Errors and Exception
  • 4 minute read

TypeError: list indices must be integers or slices, not str

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 28, 2022
If you are accessing the elements of a list in Python, you need to access it using its index position or slices. However, if you try to access a list…
View Post
Python String Swapcase()
  • Python
  • String Methods
  • 1 minute read

Python String swapcase()

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Python string swapcase() method is a built-in function that converts all uppercase characters into lowercase and all lowercase characters into uppercase characters of a given string and returns a new…
View Post
Typeerror: 'Int' Object Is Not Subscriptable
  • Python
  • Errors and Exception
  • 3 minute read

Python TypeError: ‘int’ object is not subscriptable

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python, we use Integers to store the whole numbers, and it is not a subscriptable object. If you treat an integer like a subscriptable object, the Python interpreter will raise TypeError:…
View Post
Typeerror: Can’t Multiply Sequence By Non-Int Of Type ‘Float’
  • Python
  • Errors and Exception
  • 3 minute read

[Solved] Python can’t Multiply Sequence by non-int of type ‘float’

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The TypeError: can’t multiply sequence by non-int of type ‘float’ occurs if we use the multiply operator between a string and float value.  In this tutorial, we will learn what…
View Post

Posts navigation

Previous 1 2 3 … 5 Next
  • Metrics Converter
  • Sitemap
  • Privacy Policy
  • Cookie Policy
  • Contact Us
541
98
0
0
ItsMyCode
Copyright © 2022· All Rights Reserved