« first day    last day (337 days later) » 

3:36 PM
6
Q: Can we do this in O(nlogn) instead of O(n^2)?

Adithya SwaroopGiven two permutations of (1, 2, 3,..N), Consider for n = 5 5 4 3 2 1 3 2 4 1 5 Find number of pairs (a,b) such that index(a)<index(b) in both of the permutations? In the above case, answer is 4. (4,1) index(4)<index(1) in both permutations. (3,1) (2,1) (3,2) We can easily do this in O(n2...

 
 
7 hours later…
10:36 PM
6
Q: Python fill missing values according to frequency

astro123I have seen a lot of cases missing values are either filled by mean or medians. I was wondering how can we fill misssing values with frequency. Here is my setup: import numpy as np import pandas as pd df = pd.DataFrame({'sex': [1,1,1,1,0,0,np.nan,np.nan,np.nan]}) df['sex_fillna'] = df['sex'].fi...

 

« first day    last day (337 days later) »