Python
- 16 February
Remove Backslash from String in Python
1. Introduction to the Problem Statement In Python, working with strings containing special characters such as backslashes (\) is a frequent occurrence. Whether it’s for cleaning data or preparing strings for further processing, understanding how to effectively remove these characters is essential. Consider the string “This is a test\\string with\\backslashes\\”, where our goal is to […]
- 13 February
Remove Quotes from String in Python
1. Introduction Python, a versatile and widely-used programming language, offers various methods for manipulating strings. One common task is removing double quotes (“) from strings. This task can arise in data processing, file handling, or while working with user inputs. For instance, consider the string: "Hello, "World"!". Our task is to remove the double quotes […]
- 11 February
Add Seconds to Datetime in Python
Date and Time in Python Python provides us with the datetime module that can be used to create datetime objects which can store and manipulate with date and time. This module is equipped with a lot of functionalities to work with such values with ease. We can specify all the attributes of time up to […]
- 08 February
Remove Parentheses from String in Python
In this article, we will see how to remove parentheses from String in Python. Parentheses are normal brackets, generally used for function calling in Python. In strings, we can use them for clarity purposes like any other character. Sometimes on reading a string from unknown sources, we may find characters like this at uncanny positions. […]
- 08 February
Remove Word from String in Python
Remove Word from String in Python In this tutorial, different methods are demonstrated on how to remove word from string in Python. We will study two ways to achieve this. First, we will discuss how to remove a specific word from sentences in Python. Then, we will discuss how to remove duplicate words from a […]
- 01 February
[Fixed] SyntaxError: Unexpected Character After Line Continuation Character
While programming in python, sometimes we need to write very long statements. For better presentation, we often use line continuation character. However, if you don’t use line continuation character correctly, SyntaxError occurs with the message “SyntaxError: unexpected character after line continuation character in python”. In this article, we will discuss the possible cases when this […]
- 01 February
[Fixed] Object of Type int64 Is Not JSON Serializable
JSON objects are used extensively in data transmission or in data interchange between different languages. To transmit data, we often convert the data to JSON objects. After that, we transmit the data. Sometimes, while creating a JSON object, your program might run into the TypeError exception with the message “object of type int64 is not […]
- 30 January
List of Strings in Python
Lists are one of the most used data structures in Python. In this article, we will discuss how to perform different operations on a list of strings in Python. Create a List of Strings in Python To create a list of strings, you can use the square brackets along with the string values as follows. […]
- 23 January
Get year from Date in Python
In this post, we will see how to get year from Date in Python. Dates in Python There are no data types for a date in Python. We can store and process them as strings. However, we have the datetime module to work with objects that can store and process date as well as time. […]