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 / re.md
Last active June 25, 2020 00:53
[Regular Expression] split text according to requirement #Python

Use re(regular expression) to split text

re.split('\W+|_',x)

We use | to seperate symbols that we want to use as spliter. Here \W+ means words. An example is following,

>>>text = 'I:\\Textual Analysis Data\\19950131_10-K_edgar_data_69970_0000950152-95-000069_1.txt'
>>>re.split('\W+',text)
['I',
@ChengLuFred
ChengLuFred / dataframe.md
Last active October 4, 2020 01:12
[Data Process] #Python

0 Package

import pandas as pd

1 Index and locating

create multiple index and locate data according to multi-level index

@ChengLuFred
ChengLuFred / flow_chart.md
Last active July 15, 2020 02:37
[Graph in Latex] #Latex

0 Package

\usepackage{tikz}                               % package Tikz for flow chart
\usetikzlibrary{shapes.geometric, arrows}       % package Tikz for flow chart

1 Defination of Node in Flow Chart

To begin with, we need define some nodes with specific shape and attributes.

@ChengLuFred
ChengLuFred / operaters.md
Created September 16, 2020 03:17
[Operators in R] #R
%in%
@ChengLuFred
ChengLuFred / package_management.md
Last active October 25, 2020 22:46
[Package Management in Python] smart way to import modules #Python

Import module from different file

import file_name as fn

or

from file_name import *