本文整理汇总了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()