source
Result
Result (type:str,
df:polars.dataframe.frame.DataFrame|polars.lazyframe.frame.LazyFr
ame, title:str, description:str, summary_data:dict,
formatted_data:list[str])
Class for results from Conc reports
type
str
report type
df
polars.dataframe.frame.DataFrame | polars.lazyframe.frame.LazyFrame
Polars dataframe or lazyframe with the results
title
str
title of the report
description
str
description
summary_data
dict
summary data (ignored)
formatted_data
list
list of formatted data about the table
source
Result.to_frame
Result.to_frame (collect_if_lazy:bool=True)
Return result output from conc as a dataframe
collect_if_lazy
bool
True
if the df is a lazyframe, collect before returning
source
Result.display
Result.display ()
Print analysis result output from conc in a nice table format using the great_tables library
source
Result.to_html
Result.to_html (collect_if_lazy:bool=True)
Return result output from conc as a dataframe
collect_if_lazy
bool
True
if the df is a lazyframe, collect before returning
result = Result(type = 'example' ,
df = pl.DataFrame({'Token' : ['Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' ],
'Frequency' : [5 , 4 , 3 , 2 , 1 ]}),
title = 'Example Table' ,
description = 'This is an example result.' ,
summary_data = {},
formatted_data = ['Formatted data text example 1' , 'Formatted data text example 2' ]
)
result.display()
This is an example result.
Monday
5
Tuesday
4
Wednesday
3
Thursday
2
Friday
1
Formatted data text example 1
Formatted data text example 2
shape: (5, 2)
str
i64
"Monday"
5
"Tuesday"
4
"Wednesday"
3
"Thursday"
2
"Friday"
1