5 Star 3 Fork 1

小鱼干 / cDataFrame

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

cDataFrame

简单的2维数据处理库

目录

开发情况

功能情况

  • csv文件io支持 [✔]
  • dataframe构造(construct) [✔]
  • dataframe修改 [待完成]
    1. 删除 [待完成]
    1. 修改 [待完成]
    1. 增加 [待完成]
    1. 合并 [待完成]
    1. 去重 [待完成]
    1. 基础查找 [完成]
  • dataframe↓查找拓展(AVL_p) [待完成]
    1. AVL树形构造 [待完成]
    1. AVL操作 [待完成]
  • dataframe↓匹配拓展(match_p) [完成]
    1. 表达式计算 [完成]
    1. match接口 [完成]
    1. eval接口 [完成]
  • dataframe↓HASH拓展(hash_p) [待完成]
    1. hash构造 [未完成]
    1. 冲突调解 [未完成]
  • dataframe统计拓展(statu_p) [待完成]
    • 数值型
      1. 求和 [完成]
      1. mean [完成]
      1. median [待完成]
      1. sortby [待完成]
      1. bp [待完成]
      1. ...
    • 数学型
      1. 高精度运算 [待完成]
      1. ...
  • ...

开发规范

  • 使用c11标准
  • 希望使用下划线命名法/pascal命名法

开发预期

该项目希望通过开发来增加对算法、数据结构、优化、架构等能力的掌握。还有开发具有实用性的工具。还有可以交友(小声bb)

使用方法

欢迎使用cRainbowconsole

构建

There are serval ways to incorporate cDataFrame into your projects

将源码文件添加至您的项目中

整个ccrainbow工具仅含有两个文件,您可以直接将 cDataFrame.hcDataFrame.c 添加到您的项目中并开始使用. 可以使用如下方式来将cDataFrame添加至您的源代码中

#include "cDataFrame.h"

为了尽可能多的支持各种平台和编译器,cDataFrame是使用ANSI C (C89)标准编写。

数据结构

cell 数据单元结构,可以包含[int,float,string]等结构 columns 列结构,由一个cell表和一个columns链表组成 dataframe 数据表结构,由若干个列结构组成

cell

/* The cell structrue: */
typedef struct _cell //一个单元
{   
    element data;
    type type;
}cell;

The element structure

/* The element structrue: */
typedef union _element //cell的数据用此类型
{
    char char_ch[200]; //不能超过199个字节
    size_t integer_num;
    double float_num;
    char nan[4];
}element;

columns

The columns structrue

/* The columns structrue: */
typedef struct _columns//该结构只允许访问链表的表头
{
    size_t index;
    char name[COL_NAME_LENGTH_MAX]; //列名称
    struct _columns* next_col;
    series series;
}column;

The series structrue

/* The series structrue: */
typedef struct _series //一个cell表
{
    cell* cell_table;
    size_t size;
    size_t top;
}series;

dataframe

The dataframe structrue

/* The dataframe structrue: */
typedef struct _dataframe //数据表
{
    size_t length;
    size_t width;//size info
    column* col;//columns 链表头
}dataframe;

API

FILE level operate

read_csv(const char* path) 该接口返回一个dataframe对象,该dataframe包含从csv文件中解析到的数据
to_csv(dataframe* df,const char* path) 允许将dataframe对象存储至csv文件中

dataframe level operate

dfprint(dataframe* df) 该接口将把df中的数据按格式输出至console中
cellfind(dataframe* df,size_t col,size_t index) 该接口将返回在df[col,index]处的cell*但是不建议直接更改该cell

开始使用cDataFrame

开源声明

MIT License

Copyright (c) 2009-2017 GuoZi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

帮助

如果在使用cDataFrame的过程中遇到了问题,您可以在此处或issue中寻找解决方法

  • 果子 (original author)
MIT License Copyright (c) 2020 肖永杲-2019211902-2019211408 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

简单的2维数据处理库 展开 收起
C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/bupt_xyg/cDataFrame.git
git@gitee.com:bupt_xyg/cDataFrame.git
bupt_xyg
cDataFrame
cDataFrame
master

搜索帮助