简单的2维数据处理库
该项目希望通过开发来增加对算法、数据结构、优化、架构等能力的掌握。还有开发具有实用性的工具。还有可以交友(小声bb)
There are serval ways to incorporate cDataFrame into your projects
整个ccrainbow工具仅含有两个文件,您可以直接将 cDataFrame.h
和 cDataFrame.c
添加到您的项目中并开始使用.
可以使用如下方式来将cDataFrame添加至您的源代码中
#include "cDataFrame.h"
为了尽可能多的支持各种平台和编译器,cDataFrame是使用ANSI C (C89)标准编写。
cell
数据单元结构,可以包含[int,float,string]等结构
columns
列结构,由一个cell表和一个columns链表组成
dataframe
数据表结构,由若干个列结构组成
/* 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;
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;
The dataframe structrue
/* The dataframe structrue: */
typedef struct _dataframe //数据表
{
size_t length;
size_t width;//size info
column* col;//columns 链表头
}dataframe;
read_csv(const char* path)
该接口返回一个dataframe
对象,该dataframe
包含从csv文件中解析到的数据
to_csv(dataframe* df,const char* path)
允许将dataframe
对象存储至csv文件中
dfprint(dataframe* df)
该接口将把df
中的数据按格式输出至console中
cellfind(dataframe* df,size_t col,size_t index)
该接口将返回在df
的[col,index]
处的cell*
但是不建议直接更改该cell
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中寻找解决方法
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型