简体   繁体   English

Excel 使用 Python 重塑数据

[英]Excel data reshaping with Python

I have a particular spreadsheet which has point of sale data exported feom a sql database.我有一个特定的电子表格,其中包含从 sql 数据库导出的销售点数据。 Im trying to migrate to a new point of sale system and si i need to copy this data that i exported into a csv file into another csv file which has a different format, for example different columns thatvi have to rearrange the original data into.我正在尝试迁移到新的销售点系统,并且我需要将我导出到 csv 文件的这些数据复制到另一个具有不同格式的 csv 文件中,例如,vi 必须将原始数据重新排列到的不同列。 Im trto do this using python but im failing to find a way to automate this task.我使用 python 来执行此操作,但我找不到自动执行此任务的方法。 Does anyone have any ideas or any videos on a similar project有没有人对类似项目有任何想法或任何视频

Pandas seems like the python tool for you. Pandas看起来像是适合您的 python 工具。

Open up the first CSV file with Pandas as a DataFrame , apply any modifications you want, and save as a new CSV file.打开第一个 CSV 文件,其中 Pandas 作为DataFrame ,应用您想要的任何修改,并保存为新的 ZCC8D638C551C7DE4ADEAFDZ 文件。 There is A LOT of documentation and support for Pandas, so I'm sure you can find tutorials on how to do any kind of data reshaping that you want. Pandas 有很多文档和支持,所以我相信您可以找到有关如何进行任何类型的数据重塑的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM