Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yanyuechuixue/2c08bf14baf63d96224703dab75d30c0 to your computer and use it in GitHub Desktop.
Save yanyuechuixue/2c08bf14baf63d96224703dab75d30c0 to your computer and use it in GitHub Desktop.
Pandas, input string with asymmetric errors (asymmetric uncertainties) and output / export into LaTex table
```python
mass1_summary_data = pd.DataFrame()
append_dict={}
append_dict['Name'] = "Name"
append_dict[par_] = '$' + format(median, '0.2f') + "^{+" + format(plus, '0.2f') + "}" + "_{-" + format(minus, '0.2f') + "}" + '$'
mass1_summary_data=mass1_summary_data.append(append_dict,ignore_index=True)
print(summary_data.to_latex(escape=False,index=False,na_rep="$\\backslash$"))
```
Note:
Require ```\usepackage{booktabs}``` in your LaTex document.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment