Skip to content

Instantly share code, notes, and snippets.

@kzinmr
Created September 18, 2020 08:41
Show Gist options
  • Save kzinmr/ff2d2ce212cb4e51baf8eeba7026b4bc to your computer and use it in GitHub Desktop.
Save kzinmr/ff2d2ce212cb4e51baf8eeba7026b4bc to your computer and use it in GitHub Desktop.
import pandas as pd
def jpx_companies():
url = 'https://www.jpx.co.jp/markets/statistics-equities/misc/tvdivq0000001vg2-att/data_j.xls'
df = pd.read_excel(url)
# print(df.shape, df.columns)
excludes = {'ETF・ETN', 'REIT・ベンチャーファンド・カントリーファンド・インフラファンド'}
df_companies = df.loc[~df['市場・商品区分'].isin(excludes)]
# companies_set = {c for c, df_ in df_companies.set_index('銘柄名').groupby(level=0)}
return df_companies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment