API Reference¶
Auto-generated code documentation.
pro_analytics_02 ¶
demo_module_basics ¶
Demonstrate Python basics for professional analytics.
This module demonstrates fundamental Python concepts essential for data analysts, including imports, variables, functions, and function calls.
Module Information
- Filename: demo_module_basics.py
- Module: demo_module_basics
- Location: src/pro_analytics_02/
Key Concepts
- Module imports and code organization
- Variable declaration and scope
- Function definition (reusable logic)
- Function invocation and returns
Professional Applications
- Building maintainable analytics pipelines
- Creating reusable analysis functions
- Organizing code for team collaboration
- Setting up logging for production debugging
demo_basics ¶
demo_basics() -> None
Demonstrate Python basics.
Source code in src/pro_analytics_02/demo_module_basics.py
127 128 129 130 131 132 133 134 135 136 | |
main ¶
main() -> None
Entry point when running this file as a Python script.
Arguments: None (nothing is passed in the parentheses after the main).
Returns: None (nothing is returned when this function runs).
This function creates what we call side effects -
it just logs output to the console and a file.
Use the logger variable to call info() methods to log messages. Call the log_header() function once to log some key details that can help with debugging. Call the get_summary() function to get the formatted summary string, Log the summary string we get back from get_summary().
Source code in src/pro_analytics_02/demo_module_basics.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
show_builtins_example ¶
show_builtins_example() -> None
Show some Python built-in functions.
Arguments: None - nothing is passed in via the parentheses. Returns: None
Source code in src/pro_analytics_02/demo_module_basics.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
show_functions_and_fstrings ¶
show_functions_and_fstrings() -> None
Show Python functions and f-strings (formatted strings).
Arguments: None - nothing is passed in via the parentheses. Returns: None
Source code in src/pro_analytics_02/demo_module_basics.py
81 82 83 84 85 86 87 88 89 90 91 92 | |
show_naming_and_comments ¶
show_naming_and_comments() -> None
Show Python naming and comments.
Arguments: None - nothing is passed in via the parentheses. Returns: None
Source code in src/pro_analytics_02/demo_module_basics.py
48 49 50 51 52 53 54 55 56 57 58 | |
show_truths ¶
show_truths() -> None
Show that Python is case-sensitive and indentation matters.
Arguments: None - nothing is passed in via the parentheses. Returns: None
Source code in src/pro_analytics_02/demo_module_basics.py
112 113 114 115 116 117 118 119 120 121 | |
show_variables_and_types ¶
show_variables_and_types() -> None
Show Python variables and variable types.
Arguments: None - nothing is passed in via the parentheses. Returns: None
Source code in src/pro_analytics_02/demo_module_basics.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |