["HOME", "Office", "SHOPPING"]
列表和一个大熊猫数据帧“DF”
Start_Location End_Location Date
OFFICE HOME 3-Apr-15
OFFICE HOME 3-Apr-15
HOME SHOPPING 3-Apr-15
HOME SHOPPING 4-Apr-15
HOME SHOPPING 4-Apr-15
SHOPPING HOME 5-Apr-15
SHOPPING HOME 5-Apr-15
HOME SHOPPING 5-Apr-15
我想创建一个HOME 3个不同的数据帧中创建多个数据帧,Office,SHOPPING使用for循环,但我无法做到这一点。
我是新来的蟒蛇
请帮助。
感谢 露西
什么是你的问题?你不知道如何编写for循环? – Goyo
我知道如何编写循环。我的问题是如何使用for循环创建3个不同的数据帧,如df1 = DF [DF.Start_Location == locations [0]]。希望这可以帮助 – Lucy
不是。你的代码对我来说很合适。 – Goyo