Mathew K Analytics

Pandas

Optimizing Memory Usage with Pandas Categorical Data Types for Efficient Analysis

Free video lesson with a downloadable Jupyter notebook from the Pandas course.

⬇ Download notebookOpen in Colab ↗

Data

No separate download needed — the notebook creates or downloads everything it uses.

📓 Full notebook

Download .ipynb
 
from elevenlabs.client import ElevenLabs
import os

API_KEY = "YOUR_SECRET_HERE"  # or replace with your key
VOICE_ID = "ozCzG76TxJU1hEp0JKDw"       # your cloned voice id

client = ElevenLabs(api_key=API_KEY)

def narrate(text, output_file="narration.mp3"):
    print("🧠 Generating narration...")

    audio = client.text_to_speech.convert(
        voice_id=VOICE_ID,
        model_id="eleven_multilingual_v2",
        text=text
    )

    # Save the audio file
    with open(output_file, "wb") as f:
        for chunk in audio:
            f.write(chunk)

    print(f"🎧 Narration saved as: {output_file}")


# Example usage
if __name__ == "__main__":
    script = """
    Welcome to Mastering Python Lists - From Basics to Advanced Techniques!
    In this lesson, we will explore all the essential Python list operations with real-world examples.
    By the end, you will be comfortable working with lists for a wide range of everyday tasks.
    """
    narrate(script)
🧠 Generating narration...
🎧 Narration saved as: narration.mp3

Found this useful?

All lessons, notebooks and datasets here are free. If they helped you, a coffee keeps new lessons coming.