Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PandasのDataFrameをJIRAのテーブル(Wikiマークアップ)文字列に変換
import pandas as pd
def dataframe_to_wikitable(df):
lines = []
columns = df.columns.values
lines.append('|| ' + ' || '.join(columns) + ' ||')
for ix, row in df.iterrows():
line = '| ' + ' | '.join(str(row[col]) for col in columns) + ' |'
lines.append(line)
return '\n'.join(lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment