我在熊猫数据框中有一列成分。我需要删除除成分名称之外的所有内容(例如:1/3 杯腰果 > 腰果)。
输入
recipe_name ingredient
0 Truvani Chocolate Turmeric Caramel Cups ? cup cashews
1 Truvani Chocolate Turmeric Caramel Cups 4 dates
2 Truvani Chocolate Turmeric Caramel Cups 1 tablespoon almond butter
3 Truvani Chocolate Turmeric Caramel Cups 3 tablespoons coconut milk
4 Truvani Chocolate Turmeric Caramel Cups ½ teaspoon vanilla extract
Run Code Online (Sandbox Code Playgroud)
预期产出
recipe_name ingredient
0 Truvani Chocolate Turmeric Caramel Cups cashews
1 Truvani Chocolate Turmeric Caramel Cups dates
2 Truvani Chocolate Turmeric Caramel Cups almond butter
3 …Run Code Online (Sandbox Code Playgroud)