Simple DataFrames library

Aravinda VK mail at aravindavk.in
Sat Nov 23 15:01:44 UTC 2024


On Friday, 22 November 2024 at 09:53:04 UTC, tastyminerals wrote:
> On Tuesday, 29 October 2024 at 16:11:08 UTC, Aravinda VK wrote:
>> Hello everyone,
>>
>> I am happy to share my DataFrame library for D. My primary 
>> focus was to make it simple to use and I haven't spent a lot 
>> of time optimizing the code for memory and performance.
>>
>> [...]
>
> Cool, something that is definitely missing in D is a native 
> data frame library.
>
> I have a question that can be also a suggestion. Why don't you 
> use **mir-algorithm** library instead?

Thanks for the feedback. Nothing against mir-algorithm but I 
haven't used it.

For one of my use case, I started storing each fields as 
different array. This really enhanced the experience of columnar 
operations. Later, I searched for a DataFrame library but I 
couldn't find any.

I found the idea of storing each fields of a struct as 
independent array instead of storing array of struct very 
interesting. I started the DataFrame project. The API is very 
simple to use, given a struct, a new DataFrame class will be 
created with each field of input Struct as array of same type. 
For example, `double amount` of input struct will be `double[] 
amount` in the DataFrame class.

All Column based operations are equivalent to doing array 
operations using D standard library. For example, 
`df.amount.maxElement` or `df.amount.sum`.

Please check the project README 
(https://github.com/aravindavk/dataframes-d) for usage details.

Made the new release with couple of enhancements:

- Column!T.data is changed to Column!T.values (`1.0.1`)
- Added support to create a new DataFrame from the list of the 
rows or from a DataFrame. (`1.0.1`)
- Make Column and Row type available after import dataframes 
(`1.0.2`)
- Add support to add/subtract/multiply/divide numeric to Column 
(`1.0.3`)
- Add head and tail methods and update the documentation (`1.0.3`)
- Add support to access column by label and index (`1.0.3`)




More information about the Digitalmars-d-announce mailing list