Let’s start with Java language. Strings in Java, by default, are immutable – objects whose state cannot be modified after it is defined. The opposite of an immutable object is mutable.
Continue readingCategory Archives: Python
Set Environment Variable in Python Script
All environment variables (both system and user variables) can be assessed on the os.environ attribute in Python.
The attribute returns a dictionary of all environment variables with keys as the variable names and values as environment values. The resulting dictionary supports all the operations of a native Python dictionary.
Continue readingRemove Punctuation with NLTK in Python
When working on an NLP project, removing punctuation marks from text data is a crucial pre-processing step to filter useless data (punctuation marks are not valuable for the most part).
Continue readingConverting GeoJSON to Shapefile in Python
GeoJSON (.geojson) and shapefiles (.shp) are file formats for storing geographic data structures. This guide will go through three methods for converting a GeoJSON file into a shapefile.
Continue readingCannot Convert String to Float in Python
The “ValueError: could not convert string to float:<>” is an exception that is raised when we attempt to convert a string that cannot be converted into float using the float() function, for example, an empty string and a string with non-numeric characters.
Continue readingSend Form Data With Requests in Python
The requests library is a great tool for making requests to the web using Python. This article will discuss using this module to send form data to a site. In particular, we will be using the requests.post(url, data=None, json=None) function.
Continue readingRegex Replace Group in Python
This article goes through two things: how to capture groups in Python regex and how to replace the groups within a string.
Continue readingCloning GIT Repository in Python
This article will discuss different methods of cloning a code repository (repo) using GIT and Python. You will need to fetch the repo URL (HTTPS or SSH) first, as shown in the Figure below.
Continue readingPrint Environment Variables in Python
Environment variables are computer values that affect various aspects of a program and the entire computer system.
Continue readingFind a Word in a String Using Regex and Python
The re package is a core module for regular expressions in Python. This article will cover ways of searching for a word in a string using this package.
Continue reading