-
Notifications
You must be signed in to change notification settings - Fork 0
Pandas_Numpy
-
Read file with index column from data https://stackoverflow.com/questions/36606931/how-to-set-in-pandas-the-first-column-and-row-as-index
-
Take rows/columns based on some criteria https://stackoverflow.com/questions/17071871/select-rows-from-a-dataframe-based-on-values-in-a-column-in-pandas
-
Create a pandas array with row and column names
expression_matrix_pd = pd.DataFrame(expression_matrix_np, columns = ['a','b']//expression_matrix.columns, index = ['1','2']//expression_matrix.index)
-
Different indices Numpy vs Pandas
x = np.array[[1,2,3],[4,5,6]]
x[[0,1],[0,1]] => [1, 5]
y = pd.DataFrame(x, ['1', '2'], ['A', 'B', 'C'])
y.loc[['1', '2'], ['A', 'B']]
=> 2x2 matrix. -
Conditional selection df = pd.DataFrame
-
Numpy sort rows/columns https://gist.github.com/stevenvo/e3dad127598842459b68
-
Concat empty array https://stackoverflow.com/questions/22732589/concatenating-empty-array-in-numpy/22732845