application_vnd.jupyter.stderr_output_1.png image_output_1.png
import pandas as pd

url = 'https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/datasets/swiss.csv'
df = pd.read_csv(url, index_col=0)

df.columns = ['fertility', 'agri', 'exam', 'edu', 'catholic', 'infant_mort']

formula = 'fertility ~ %s' % ' + '.join(df.columns.values[1:])
formula