try: with open(filepath) as f: data = pd.read_csv(f,names=[\'id\',\'url\']) for id, url in enumerate(data[\'url\']):