Top "In-place" questions

Use this tag on questions about algorithms that modify the data in-place, as opposed to making a copy.

How to delete from a text file, all lines that contain a specific string?

How would I use sed to delete all lines in a text file that contain a specific string?

shell sed text-parsing in-place
Python Math - TypeError: 'NoneType' object is not subscriptable

I'm making a small program for math (no particular reason, just kind of wanted to) and I ran into the …

python math sorting in-place
How can I convert tabs to spaces in every file of a directory?

How can I convert tabs to spaces in every file of a directory (possibly recursively)? Also, is there a way …

bash shell unix spaces in-place
How to sort in-place using the merge sort algorithm?

I know the question is not too specific. All I want is someone to tell me how to convert a …

arrays algorithm sorting mergesort in-place
Understanding inplace=True

In the pandas library many times there is an option to change the object inplace such as with the following …

python pandas in-place
Updating a java map entry

I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map, and I want to …

java map in-place
What is the difference between `sorted(list)` vs `list.sort()`?

list.sort() sorts the list and replaces the original list, whereas sorted(list) returns a sorted copy of the list, …

python list sorting copy in-place
In-place edits with sed on OS X

I'd like edit a file with sed on OS X. I'm using the following command: sed 's/oldword/newword/' …

macos file-io sed in-place
Pandas: drop columns with all NaN's

I realize that dropping NaNs from a dataframe is as easy as df.dropna but for some reason that isn't …

python pandas dataframe in-place
How do you append an element to a list in place in Prolog?

If I have a list in Prolog such as X = [1, 2, 3, 4], how do I add the element 5 to the end of …

list prolog append in-place difference-lists