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