本文整理匯總了Python中pandas.__file__方法的典型用法代碼示例。如果您正苦於以下問題:Python pandas.__file__方法的具體用法?Python pandas.__file__怎麽用?Python pandas.__file__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandas
的用法示例。
在下文中一共展示了pandas.__file__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: write_index
# 需要導入模塊: import pandas [as 別名]
# 或者: from pandas import __file__ [as 別名]
def write_index():
"""This is to write the docs for the index automatically."""
here = os.path.dirname(__file__)
filename = os.path.join(here, '_generated', 'version_text.txt')
try:
os.makedirs(os.path.dirname(filename))
except FileExistsError:
pass
text = text_version if '+' not in oggm.__version__ else text_dev
with open(filename, 'w') as f:
f.write(text)
示例2: write_gdir_doc
# 需要導入模塊: import pandas [as 別名]
# 或者: from pandas import __file__ [as 別名]
def write_gdir_doc():
"""This is to write the docs for glacierdir automatically."""
here = os.path.dirname(__file__)
origfile = os.path.join(here, '_templates', 'basenames.txt')
filename = os.path.join(here, '_generated', 'basenames.txt')
try:
os.makedirs(os.path.dirname(filename))
except FileExistsError:
pass
shutil.copyfile(origfile, filename)
from oggm.cfg import BASENAMES
cnt = [' ']
for k in sorted(BASENAMES.keys()):
cnt += [BASENAMES.info_str(k)] + [' ']
cnt = '\n'.join(cnt)
file = open(filename, 'a')
try:
file.write(cnt)
finally:
file.close()