最佳答案
请尝试以下方法从提到的数据中获取 Series 对象(假设 data
是您正在使用的 DataFrame)
series = pd.Series(data['Sales'], index=data.index)
希望对您有所帮助。
关于python - 将数据框转换为多列系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52329220/
最佳答案
请尝试以下方法从提到的数据中获取 Series 对象(假设 data
是您正在使用的 DataFrame)
series = pd.Series(data['Sales'], index=data.index)
希望对您有所帮助。
关于python - 将数据框转换为多列系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52329220/
相关文章:
python - python 总是同步调用 __del__ 吗?
Python/ Pandas : Selecting dataframe rows with multiple conditions - col 1 matches col 2 OR col 3
python - 如何将多个 pandas 数据帧写入单个输出 excel 文件?
python - 在 Pandas 中使用 PeriodIndex 与 DateTimeIndex ?
python - 如何找到今天和 future 日期之间的天数?