Dataframes In Fortran

Find us on…

GitHub The Web

DataFort


DataFort logo DataFort


DataFort is a dataframes library for Fortran, providing pandas/polars/dplyr-like functionality for scientific computing and data analysis.

⚠️ Warning: Project is very much a WIP. Don't use in production.

Installation


Using fpm

[dependencies]
DataFort = { git = "https://github.com/rngil/DataFort" }

From Source

git clone https://github.com/rngil/DataFort.git
cd DataFort
fpm build

To run tests:

fpm test

Quick Start


program example
    use datafort
    use precision
    implicit none

    type(data_frame) :: df
    real(rk), dimension(3) :: temps = [23.1_rk, 25.3_rk, 24.8_rk]
    integer(ik), dimension(3) :: pressures = [1013_ik, 1015_ik, 1012_ik]

    ! Create and populate
    call df%new()
    call df_append_real(df, temps, "Temperature")
    call df_append_integer(df, pressures, "Pressure")

    ! Display
    call df_write_console(df)

    ! Statistics
    print*, "Mean temperature:", df_mean_real(df, 1)

    ! Export
    call df_write_csv(df, "data.csv")

    ! Cleanup
    call df%destroy()
end program example

Development


make help      # Show all available commands
make build     # Build the library
make test      # Run all tests
make docs      # Generate documentation
make format    # Format code
make clean     # Clean build artifacts

Acknowledgments


DataFort is built upon the initial work from fortranDF by Joshua Aiken. While the project has been significantly extended and refactored with new features, the original skeleton provided a valuable foundation.

Developer Info

Renee Gil