Skip to content

Instantly share code, notes, and snippets.

@turingDH
Created March 29, 2018 04:32
Show Gist options
  • Save turingDH/e13650caa08c6b65388e915d14ac29a4 to your computer and use it in GitHub Desktop.
Save turingDH/e13650caa08c6b65388e915d14ac29a4 to your computer and use it in GitHub Desktop.
greek chr's pandas df
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment