conc
  1. API
  2. result
  • Introduction to Conc
  • Tutorials
    • Get Started with Conc
    • Quick Conc Recipes
    • Installing Conc
  • Explanations
    • Why Conc?
    • Anatomy of a corpus
    • Performance
  • Development
    • Releases
    • Roadmap
    • Developer Guide
  • API
    • corpus
    • conc
    • corpora
    • frequency
    • ngrams
    • concordance
    • keyness
    • collocates
    • result
    • plot
    • text
    • core
  1. API
  2. result

result

Conc result class.

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 Details
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

Type Default Details
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

Type Default Details
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()
Example Table
This is an example result.
Token Frequency
Monday 5
Tuesday 4
Wednesday 3
Thursday 2
Friday 1
Formatted data text example 1
Formatted data text example 2
result.to_frame()
shape: (5, 2)
Token Frequency
str i64
"Monday" 5
"Tuesday" 4
"Wednesday" 3
"Thursday" 2
"Friday" 1
  • Report an issue