Skip to content

IO

Input/Output related functions.

Functions:

Name Description
dict_to_df

Convert a nested dictionary to a dataframe.

write_csv

Write a dataframe to .csv file in output directory.

dict_to_df

dict_to_df(data)

Convert a nested dictionary to a dataframe.

Layers of pore statistics are converted to a dataframe.

Parameters:

Name Type Description Default

data

dict[int | str, Any]

Nested dictionary to be converted.

required

Returns:

Type Description
DataFrame

Pandas dataframe of statistics.

write_csv

write_csv(df, outdir='output', filename='results.csv')

Write a dataframe to .csv file in output directory.

Parameters:

Name Type Description Default

df

DataFrame

Pandas dataframe to write to disk.

required

outdir

Path | str

Path where file is to be written.

'output'

filename

str

Filename for output, defaults to results.csv.

'results.csv'