목록전체 글 (462)
Note
SELECT * FROM 테이블 WHERE MATCH(column) AGAINST('키워드 1' in boolean mode) UNION ALL SELECT * FROM 테이블 WHERE MATCH(column) AGAINST('키워드 2' in boolean mode); 중복 포함 결과물
How to create a new column from existing columns of a numpy array? # Input url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data' iris_2d = np.genfromtxt(url, delimiter=',', dtype='object') # Solution # Compute volume sepallength = iris_2d[:, 0].astype('float') petallength = iris_2d[:, 2].astype('float') volume = (np.pi * petallength * (sepallength**2))/3 # Introduce ne..
How to count the number of missing values in each column? # Input df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/Cars93_miss.csv') # Solution n_missings_each_col = df.apply(lambda x: x.isnull().sum()) n_missings_each_col.argmax() # output 'Luggage.room'
How to convert a numeric to a categorical (text) array? # Input url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data' iris = np.genfromtxt(url, delimiter=',', dtype='object') names = ('sepallength', 'sepalwidth', 'petallength', 'petalwidth', 'species') # Bin petallength petal_length_bin = np.digitize(iris[:, 2].astype('float'), [0, 3, 5, 10]) # Map it to respective cat..