Skip to content

Instantly share code, notes, and snippets.

View ChengLuFred's full-sized avatar

Cheng ChengLuFred

  • Stevens Institute of Technology
  • Hoboken
View GitHub Profile
@ChengLuFred
ChengLuFred / read_data_r.md
Created April 15, 2020 01:38
[Read Data in R] read .csv etc. tables into R #R

row.names argument also can be number denoting which column to be used as index

data <- read.csv('homework05.csv', header = TRUE, row.names = c('DATE'))
@ChengLuFred
ChengLuFred / path.md
Last active June 25, 2020 19:59
[Path Management] #Python

check path validation

if not os.path.exists(OUTPUT_FILE_PATH):
            os.makedirs(OUTPUT_FILE_PATH)
            if verbose:
                print('Path: {0} created'.format(OUTPUT_FILE_PATH))
  • path containing number need double slash \\ before number
@ChengLuFred
ChengLuFred / quantmod.md
Last active April 3, 2020 21:18
[Quantmod] #R

Download Data

Download stock prices from yahoo finance

getSymbols.yahoo(Symbols = "MSFT",
                 env = globalenv(),
                 index.class  = 'Date',
                 from = "1980-01-01",
                 to = "2019-12-31",
                 periodicity = "daily")
@ChengLuFred
ChengLuFred / Moment.md
Last active July 11, 2020 21:51
[Math Note] #Math

Moment for Gaussian distributed variable $X \sim \mathcal{N}\left(0, \sigma^{2}\right)$ $$E\left[X^{2 n}\right]=(2 n-1) ! ! \sigma^{2 n}$$

@ChengLuFred
ChengLuFred / windows_configure.md
Last active September 14, 2021 09:24
[Windows] #Windows

Screen shot autosave

windows + PrintScreen

This command autosaves the current screen shot into C:\Users\cheng\Pictures\Screenshots