Filter NaN Pandas
To filter out the rows having the NaN values in Python, the “dataframe” functions, such as “dataframe.notnull()”, and “dataframe.dropna()” functions are used.
Read MoreTo filter out the rows having the NaN values in Python, the “dataframe” functions, such as “dataframe.notnull()”, and “dataframe.dropna()” functions are used.
Read MoreTo save the dictionary into a file in Python, the “dump()” function is used and the “load()” function is used to read the saved dictionary from a file.
Read MoreTo remove special characters from the string in Python, the “isalnum()”, “replace()”, “translate()”, “filter()”, and “re.sub()” methods are used.
Read MoreAny developer who wants to write out effective and efficient code must be familiar with using operators in Python.
The post 7 Different Types of Operators in Python [With Examples] appeared first on Linux Today.
To convert a Python list to a comma-separated string, apply “join()” method, “join()” with “List Comprehension” approach, “for” loop, or the “StringIO” module.
Read MoreIn Python, the “math.exp()” function of the “math” module is used to calculate the exponent power of numeric values such as “int” and “float”.
Read MoreThe “os.path.expanduser()” method allows us to easily expand paths that start with “~” or “~user” to the appropriate home directory path.
Read MoreIn Python, the “StringIO” module is used to manipulate strings as if they were files. This module provides various methods to perform specific tasks in Python.
Read MoreTo create, and customize the horizontal bar plot the “seaborn.barplot()” function of the “seaborn” library is used with various parameters in Python.
Read MoreTo write a string to file various methods such as the “write()” method, “with” statement, and “fileinput” module are used in Python.
Read MoreTo convert an exception to a string the “str()” function, “traceback.format_exc()” function, and “repr()” function is used in Python.
Read MoreThe “zipfile” module and the “shutil” module are used to unzip single or multiple files from the specified zip file in Python.
Read MoreTo count characters in a string in Python, apply the “len()” function, “Counter” class from the collections module, “dictionary comprehension”, etc.
Read MoreTo count the occurrences in a list in Python, apply the “count()” method, “Counter” class, “operator” module, “List Comprehension” approach, or the “for” loop.
Read MoreThe “fontweight” and “weight” parameters are used to bold a text in Matplotlib. It is used to emphasize key information and enhance visualizations.
Read MoreTo convert the given string to a set, various methods such as “set()” function, “add()” method, or the “set comprehension” can be used in Python.
Read MoreThe xrange() function in Python 2.x or range() function in Python 3.x is used for efficient iteration over a range of values.
Read MoreThe “for” loop, “enumerate()” function, “index()” method, or the “defaultdict()” function can be used to find the index of all occurrences in a list in Python.
Read MoreThe “astype()” method of the numpy module is used to change the data type of a NumPy array into other data types such as str, int, complex, etc.
Read More“not” operator, “len()” function, “strip()” function, “==” operator, “__eq__()” method, or “not + str.isspace()” method can check if string is empty in Python.
Read More