Development Leftovers
-
Checking usage of realloc with Valgrind
One of the C dynamic memory allocation functions is
realloc
. Given a pointer,realloc
will resize the memory block it points to. This sounds like a simple and useful mechanism to do memory management. Butrealloc
has various gotchas that Valgrind Memcheck can check for to ensure you use the function correctly. Memory blocks should exist and have not yet been freed, blocks can be moved when resized, on failure to resize the memory block might leak, and what happens when a block is reduced to zero size might be undefined. -
Pandas Merge on Multiple Columns
In Python, the “pandas.merge()” method of the “pandas” module is utilized to merge the multiple columns of two Pandas DataFrame.
-
Logical Operators in Python
Python, one of the world’s most popular programming languages, supports a wide range of operators, including arithmetic, comparison, assignment, bitwise, and logical operators. In this article, we’ll focus on Python’s logical operators, exploring their usage and significance in coding various logical operations. What are Logical Operators?
-
Python List to CSV
In Python, the “write()”, “CSV”, “to_csv()”, and the “savetxt()” methods are utilized to create a CSV file from the input list.
-
Pandas Sum Column
The “DataFrame.sum()” method or “DataFrame.eval()” method is used to add all the columns or specified columns of Pandas DataFrame in Python.
-
Pandas Between Dates
In Python, “df.loc[]”, “df.query()”, and the “df.isin()” methods are used to select the rows of Pandas DataFrame that fall within the specified dates.
-
Pandas DataFrame Remove Index
The “pd.reset_index()” method of the “pandas” module is used to remove/drop the single or multiple indexes of the Pandas DataFrame.