1.
>>> import pandas as pd
>>> df = pd.read_csv('sample.csv')
>>> df
id images
0 0 https://image.png?width=640
1 1 https://image2.png?width=640
2 2 https://image3.png?width=640
>>> df['images'] = df['images'].str.split('?').str[0]
>>> df
id images
0 0 https://image.png
1 1 https://image2.png
2 2 https://image3.png
2.
import csv
>>> with open('sample.csv', 'r') as f:
... rows = list(csv.DictReader(f))
...
>>> rows
[OrderedDict([('id', '0'), ('images', 'https://image.png?width=640')]), OrderedDict([('id', '1'), ('images', 'https://image2.png?width=640')]), OrderedDict([('id', '2'), ('images', 'https://image3.png?width=640')])]
>>> rows = [{k: v.split('?')[0] if k=='images' else v for k, v in row.items()} for row in rows]
>>> rows
[{'id': '0', 'images': 'https://image.png'}, {'id': '1', 'images': 'https://image2.png'}, {'id': '2', 'images': 'https://image3.png'}]