Chapter 11 — Reporting

Reporting & Communication

Export results, format outputs, and communicate your findings clearly to stakeholders.

11.0 Reporting structure (what to include)
  1. Context and goalState the business question, period, scope, and why this analysis matters.
  2. Data quality summaryMention missingness, exclusions, cleaning rules, and any bias risks.
  3. Core findingsShare 3-5 key insights with numbers, not only visuals.
  4. Method transparencyExplain transformations, statistics/tests/models used and why they were selected.
  5. LimitationsClearly state what you cannot claim from this dataset.
  6. Actionable recommendationsTie each recommendation to evidence and expected impact.
Report elementUse whenWhySkip when
Executive summaryAny stakeholder audienceGives fast decisions without technical detailNever skip
Technical appendixData/ML teams review resultsEnsures reproducibility and trustSkip for non-technical one-page brief
Raw table dumpAudit/compliance requestTraceabilitySkip in presentation deck; move to appendix
Method comparisonYou tested multiple approachesShows why final method was chosenSkip only if one method was clearly mandated
11.1 Export tables and results
python
# Export to CSV
df.to_csv('output/results.csv', index=False)

# Export multiple sheets to Excel
with pd.ExcelWriter('output/report.xlsx', engine='openpyxl') as writer:
    df.to_excel(writer, sheet_name='Data', index=False)
    df.describe().to_excel(writer, sheet_name='Summary')
    summary.to_excel(writer, sheet_name='Analysis', index=False)

# Save a chart as high-resolution image
plt.savefig('output/chart.png', dpi=150, bbox_inches='tight')
11.2 Format DataFrame for display
python
# Style table in Jupyter
(df.style
  .highlight_max(subset=['sales'], color='#d4edda')
  .highlight_min(subset=['sales'], color='#f8d7da')
  .format({
      'sales': '${:,.0f}',
      'growth_pct': '{:.1%}',
      'date': '{:%Y-%m-%d}'
  })
  .background_gradient(subset=['score'], cmap='RdYlGn')
  .set_caption('Monthly Sales Report')
)
11.3 Create a summary dashboard function
python
def quick_report(df, numeric_col, category_col=None):
    """Quick summary report for any numeric column."""
    print(f"=== Report: {numeric_col} ===")
    print(f"Count:    {df[numeric_col].count():,}")
    print(f"Mean:     {df[numeric_col].mean():,.2f}")
    print(f"Median:   {df[numeric_col].median():,.2f}")
    print(f"Std Dev:  {df[numeric_col].std():,.2f}")
    print(f"Min/Max:  {df[numeric_col].min():,.2f} / {df[numeric_col].max():,.2f}")

    if category_col:
        print(f"
By {category_col}:")
        print(df.groupby(category_col)[numeric_col].mean().sort_values(ascending=False))

quick_report(df, 'salary', 'department')
11.4 Analytics project checklist
11.5 Full library reference
LibraryPurposeKey functions
pandasData manipulationread_csv, groupby, merge, pivot_table
numpyMath & arraysarray, mean, std, log1p, where
matplotlibBase plottingplot, subplots, savefig
seabornStatistical chartshistplot, boxplot, heatmap, pairplot
plotlyInteractive chartsscatter, bar, line, choropleth
scipyStatistical teststtest_ind, chi2_contingency, normaltest
scikit-learnMachine learningfit, predict, cross_val_score, GridSearchCV
openpyxlExcel filesUsed by pandas to read/write xlsx
Great analysts ask "why?" at every step. Numbers tell a story — your job is to find it and communicate it clearly.
Dashboard & business storytelling
Build your final output in Power BI, Tableau, or Excel depending on stakeholder tooling. Export a clean dataset and always answer three questions: what happened, why it happened, and what we should do next.
Common mistakes to avoid
Quick cheatsheet
df.info() -> Structure and non-null counts
df.describe() -> Numeric summary statistics
df.isnull().sum() -> Missing-value counts by column
df.groupby() -> Segmented aggregation
pd.merge() -> Join multiple datasets