pandas DataFrame: replace nan values with average of columns
I've got a pandas DataFrame filled mostly with real numbers, but there is a few `nan` values in it as well. How can I replace the `nan`s with averages of columns where they are? This question is ver...
How do I replace all line breaks in a string with <br /> elements?
How can I read the line break from a value with JavaScript and replace all the line breaks with `<br />` elements? Example: A variable passed from PHP as below: ``` "This is man. Man like dog...
- Modified
- 23 Mar at 19:47
Split a string by another string in C#
I've been using the `Split()` method to split strings, but this only appears to work if you are splitting a string by a character. Is there a way to split a `string`, with another string being the spl...
How to convert JSON to XML or XML to JSON?
I started to use Json.NET to convert a string in JSON format to object or viceversa. I am not sure in the Json.NET framework, is it possible to convert a string in JSON to XML format and viceversa?
change values in array when doing foreach
example: ``` var arr = ["one","two","three"]; arr.forEach(function(part){ part = "four"; return "four"; }) alert(arr); ``` The array is still with it's original values, is there any way to ha...
- Modified
- 26 Nov at 12:58
How to add a line break within echo in PHP?
I was trying to add a line break for a sentence, and I added `/n` in following code. ``` echo "Thanks for your email. /n Your orders details are below:".PHP_EOL; echo 'Thanks for your email. /n Yo...
- Modified
- 8 Oct at 05:20
Incrementing a date in JavaScript
I need to increment a date value by one day in JavaScript. For example, I have a date value 2010-09-11 and I need to store the date of the next day in a JavaScript variable. How can I increment a da...
- Modified
- 10 Sep at 19:26
I want to remove double quotes from a String
I want to remove the `""` around a String. e.g. if the String is: `"I am here"` then I want to output only `I am here`.
- Modified
- 30 Dec at 14:21
Why doesn't os.path.join() work in this case?
The below code will not join, when debugged the command does not store the whole path but just the last entry. ``` os.path.join('/home/build/test/sandboxes/', todaystr, '/new_sandbox/') ``` When I ...
How to sort an ArrayList in Java
I have a class named Fruit. I am creating a list of this class and adding each fruit in the list. I want to sort this list based on the order of fruit name. ``` public class Fruit{ private Strin...
- Modified
- 9 Jan at 10:14
Is there a list of Pytz Timezones?
I would like to know what are all the possible values for the timezone argument in the Python library pytz. How to do it?
jQuery .on('change', function() {} not triggering for dynamically created inputs
The problem is that I have some dynamically created sets of input tags and I also have a function that is meant to trigger any time an input value is changed. ``` $('input').on('change', function() ...
- Modified
- 29 Nov at 11:39
How to identify all stored procedures referring a particular table
I created a table on development environment for testing purpose and there are few sp's which are refreing this table. Now I have have to drop this table as well as identify all sp's which are referri...
- Modified
- 26 Apr at 14:45
How to disable an Android button?
I have created a layout that contains two buttons, Next and Previous. In between the buttons I'm generating some dynamic views. So when I first launch the application I want to disable the "Previous" ...
- Modified
- 24 Jul at 21:36
How can I get a list of Git branches, ordered by most recent commit?
I want to get a list of all the branches in a Git repository with the "freshest" branches at the top, where the "freshest" branch is the one that's been committed to most recently (and is, therefore, ...
- Modified
- 10 Dec at 19:42
How to set selected value of jQuery Select2?
This belong to codes prior to Select2 version 4 I have a simple code of `select2` that get data from AJAX. ``` $("#programid").select2({ placeholder: "Select a Program", allowClear: true, minimu...
- Modified
- 14 Apr at 10:26
Access denied for user 'root'@'localhost' while attempting to grant privileges. How do I grant privileges?
I've looked at a number of similar questions and so I'm demonstrating that I've checked the basics. Though of course, that doesn't mean I haven't missed something totally obvious. :-) My question is:...
- Modified
- 1 Aug at 03:52
Receive JSON POST with PHP
I’m trying to receive a JSON POST on a payment interface website, but I can’t decode it. When I print : ``` echo $_POST; ``` I get: ``` Array ``` I get nothing when I try this: ``` if ( $_POST...
Extract file basename without path and extension in bash
Given file names like these: ``` /the/path/foo.txt bar.txt ``` I hope to get: ``` foo bar ``` Why this doesn't work? ``` #!/bin/bash fullfile=$1 fname=$(basename $fullfile) fbname=${fname%.*} ...
Find CRLF in Notepad++
How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p special character in Microsoft Word.
Detect whether there is an Internet connection available on Android
> [How to check internet access on Android? InetAddress never timeouts](https://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-timeouts) I need to dete...
- Modified
- 9 Oct at 12:2
Formatting code in Notepad++
Is there a keyboard shortcut to format code in Notepad++ ? I'm mainly working with HTML, CSS and Python code. For example: ``` <title>{% block title %} {% endblock %}</title> <link rel="st...
- Modified
- 23 Aug at 19:20
How to determine SSL cert expiration date from a PEM encoded certificate?
If I have the actual file and a Bash shell in Mac or Linux, how can I query the cert file for when it will expire? Not a web site, but actually the certificate file itself, assuming I have the csr, k...
- Modified
- 11 Dec at 11:28
How to search for text in all files in a directory?
Is there a way to search for text in all files in a directory using VS Code? I.e., if I type `find this` in my search, it will search through all the files in the current directory and return the file...
- Modified
- 10 Mar at 20:44
No acceptable C compiler found in $PATH when installing python
I'm trying to install a new Python environment on my shared hosting. I follow the steps written in [this post](https://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv)...
- Modified
- 26 Sep at 14:9