从python中的数据帧制作两列的python对列表

问题描述

我有熊猫数据框

df_1 = pd.DataFrame({'x' : [a,b,c,d],'y' : [e,f,g,h]})

我需要像这样从字符串中获取:

(first_element_from_first_row,first_element_from_second_row),(second_element_from_first_row,second_element_from_second_row),................................................................
(last_element_from_first_row,last_element_from_second_row);

最后应该是分号。

就我而言,答案应该是:

(a,e),(b,f),(c,g),(d,h);

我应该如何解决我的问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)