Python 如何附加到包含时间序列的数据帧中的列

Python 如何附加到包含时间序列的数据帧中的列,python,pandas,Python,Pandas,如何将另一个列表附加到存储在timeseq=[xyz,xyz…,xyz]中的df_final['time_seq']列中,以解决您的特定问题: additional_time_seq = [1234567, 1234568] # i the index of the row you want # the line below gives you the time_seq list time_seq_to_append = df_final.loc[df_final.index[i], 'time


如何将另一个列表附加到存储在timeseq=[xyz,xyz…,xyz]中的df_final['time_seq']列中,以解决您的特定问题:

additional_time_seq = [1234567, 1234568]
# i the index of the row you want
# the line below gives you the time_seq list
time_seq_to_append = df_final.loc[df_final.index[i], 'time_seq']
# the line below extends the time_seq list with the additional_time_seq
time_seq_to_append.extend(additional_time_seq)

通常,
df.loc[df.index[i],'NAME']
,由于这是一个列表,您可以使用Python列表的内置方法。

对于您的特定问题:

additional_time_seq = [1234567, 1234568]
# i the index of the row you want
# the line below gives you the time_seq list
time_seq_to_append = df_final.loc[df_final.index[i], 'time_seq']
# the line below extends the time_seq list with the additional_time_seq
time_seq_to_append.extend(additional_time_seq)

通常,
df.loc[df.index[i],'NAME']
,因为这是一个列表,所以您可以使用Python列表的内置方法。

您需要生成完整的新行,可能是带有默认值的完整行。您需要生成完整的新行,可能是带有默认值的完整行。