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
| ## Credit to LucidProgramming https://www.youtube.com/watch?v=u2jTn-Gj2Xw for the walkthrough. My changes weren't terribly significant. | |
| import os # to get core count on machine | |
| import time # to time the duration | |
| from multiprocessing import Pool # to instantiate a Pool of workers to distribute the process across the cores in CPU | |
| def sum_square(number): | |
| s=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
| library(dplyr) | |
| library(DT) | |
| library(purrr) | |
| library(tidyr) | |
| phraseToSearch <- 'this|that' | |
| scriptFiles <- | |
| bind_rows( | |
| map_dfc('~/R', list.files, full.names = T) %>% rename(fileNames = V1), |
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
| # Load packages | |
| library(dplyr) | |
| library(sparklyr) | |
| # Set up connect | |
| sc <- spark_connect(master = "local") | |
| # Create a Spark DataFrame of mtcars | |
| mtcars_sdf <- copy_to(sc, mtcars) |
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 | |
| import pandas as pd | |
| greeks = [chr(code) for code in range(945,970)] | |
| Greeks = ['alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'word-final sigma', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega'] | |
| df = pd.DataFrame(greeks, Greeks).reset_index().reset_index() | |
| df.rename(columns={df.columns[0]:"chr_val", df.columns[1]:"greek text", df.columns[2]:"greek symbol"}, inplace=True) | |
| df['chr_val'] += 945 | |
| print(df) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.