使用Python本机容器进行数据分析的Python函数。从csv文件加载数据并像sql一样处理数据。
csv2sqllike的Python项目详细描述
csv2sqlLikecsv2sqlLike is a package for simple data analysis using light data set(<30MB). This package has filtering method similar with sql's filtering functions. Hope this package could be helpful for who analyze data in social science.
csv2sqlLike is a package for simple data analysis using light data set(<30MB). This package has filtering method similar with sql's filtering functions. Hope this package could be helpful for who analyze data in social science.
csv2sqlLike与2个主类一致。
- 伪SQLFromCSV
- 传输2SQLDB
PseudoSQLFromCSV正在对处理数据收费:
- 从csv文件加载数据和头作为嵌套列表和列表
- 过滤特定条件下的数据
- 用特定头分组数据
- 写入包含此对象内数据的csv文件
Transfer2SQLDB对Pseudo SQLFromCSV和DB之间的数据传输收费:
- 从pseudosqlfromcv中的数据在DB中创建表
- 将数据作为嵌套列表从数据库中的表中带出
安装
皮普:
pip3 installcsv2sqllike
用法
从csv文件加载数据
^{pr2}$使用条件过滤数据
data.where("[head] [operator] [specific value]")# exampledata.where("region == east-asia")# check conditions usedprint(data.condition_where)# check filtered dataprint(data.cache_data)
使用特定头部分组数据
data.group_by("[head]")# exampledata.group_by("region")# check heads used for grouping dataprint(data.condition_group_by)# check grouping data stored in dictionaryprint(data.cache_dict)
clear cache storage(用于筛选和分组的存储)
# check cache stroage befor clearing cachesprint(data.condition_where)print(data.cache_data)print(data.condition_group_by)print(data.cache_dict)# clear cache storagedata.clear_cache_data()# check cache stroage after clearing cachesprint(data.condition_where)print(data.cache_data)print(data.condition_group_by)print(data.cache_dict)
add head和delete head
print(data.header)# add new headdata.add_head("new_head")# check added headprint(data.header)# delete headdata.delete_head("new_head")# check heads after deleting specific headprint(data.header)
有关更多示例和用法,请参阅jupyter notebook。
发布历史记录
- 1.0.0
- 首次发布
- 1.0.1
- 添加编码选项(默认编码为utf-8)
- 1.0.2
- 添加所需软件包的自动安装
- 1.0.3
- 提高数据形状检查功能的精度
- 项目
标签: