用于操作数据帧的非常简单的接口
magicpandas的Python项目详细描述
在_建_工程_
magicpandas
magicpandas使与熊猫的合作变得非常简单。在
主要特点
- MagicDataFrame子类化DataFrame,使现有方法更直观,并添加新方法
- MagicDataFrame添加显示数据时默认使用的详细标签
- MagicDataFrame支持Django-ORM
- inspectdf使用DataFrame列类型生成Django模型类(参见inspectdb)
- to_django使用django ORM的bulk_update和bulk_create将数据帧保存到SQL。在
安装
pip install magicpandas
示例
frommagicpandasimportMagicDataFramemdf=MagicDataFrame(df)mdf2=mdf.drop('*e',axis=1)# df2 drops all columns ending in "e"mdf.browse()# opens the DataFrame in MS Excel with nice formattingmdf.browse(client='webbrowser')# opens the DataFrame as html displayed in Chrome with nice formattingmdf.graph()# Opens a graph in Chrome using the excellent Altair library using sensible encodingsmdf.inspect_for_django()# prints text that corresponds to a Django model definition
哲学
- 约定优先于配置
- 使用Altair而不是matplotlib,因为它是web优先的,基于 Grammar of Graphics
- 使用MS Excel进行数据浏览
- 意图和执行之间应该没有什么差距
- 项目
标签: