This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| for x in range(5): | |
| print(np.sort(np.random.choice(range(1,46),6,replace=False))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM linuxserver/bookstack:latest | |
| COPY ./install-weasyproxy.sh /tmp/ | |
| RUN sh /tmp/install-weasyproxy.sh | |
| RUN mkdir /custom-cont-init.d/ | |
| COPY ./init-weasyproxy.sh /custom-cont-init.d/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| start /b spark-master.cmd | |
| timeout 2 > NUL | |
| start /b spark-worker.cmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import connection | |
| from django.conf import settings | |
| cursor = connection.cursor() | |
| cursor.execute('SHOW TABLES') | |
| results=[] | |
| for row in cursor.fetchall(): | |
| results.append(row) | |
| for row in results: | |
| cursor.execute('ALTER TABLE %s CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' % (row[0])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import numpy as np | |
| from pandas import DataFrame, Series |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List unique values in a DataFrame column | |
| pd.unique(df.column_name.ravel()) | |
| # Convert Series datatype to numeric, getting rid of any non-numeric values | |
| df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
| # Grab DataFrame rows where column has certain values | |
| valuelist = ['value1', 'value2', 'value3'] | |
| df = df[df.column.isin(valuelist)] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| instPkgPlusDeps <- function(pkg, download = TRUE, | |
| which = c("Depends", "Imports", "LinkingTo"), | |
| inc.pkg = TRUE) { | |
| stopifnot(require("tools")) ## load tools | |
| ap <- available.packages() ## takes a minute on first use | |
| ## get dependencies for pkg recursively through all dependencies | |
| deps <- package_dependencies(pkg, db = ap, which = which, recursive = TRUE) | |
| ## the next line can generate warnings; I think these are harmless | |
| ## returns the Priority field. `NA` indicates not Base or Recommended | |
| pri <- sapply(deps[[1]], packageDescription, fields = "Priority") |
NewerOlder