PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #python tag
Create a lesson plan 'Introduction to Python for Kids (Ages 10-12)'. Activities: 1. Concept: Variables as boxes. 2. Hands-on: Hello World with emojis. 3. Concept: Loops with real-life examples (brushing teeth). 4. Project: Build a simple 'Guess the Number' game. 5. Quiz: Spot the bug. 6. Wrap-up: Show real-world apps built with Python. Include printable cheat sheet.
Optimize Pandas data processing pipeline. Techniques: 1. Vectorize operations (avoid loops). 2. Use appropriate data types (int8, category). 3. Process large datasets with chunking. 4. Parallelize processing with Dask or Swifter. 5. Efficient file formats (Parquet/Feather). 6. Memory usage profiling. 7. Index optimization for merging. 8. Caching intermediate results. Include benchmark comparisons.
I have a bug in my Python code. The function is supposed to calculate the factorial of a number, but it's returning an incorrect result for inputs greater than 5. Here is the code: [paste code here]. Help me find and fix the bug.
Design a basic CI/CD pipeline using GitHub Actions for a Python web application. The pipeline should be triggered on a push to the main branch. It should include steps for installing dependencies, running linters, executing unit tests, and deploying the application to a staging environment.
Take the following C-style for-loop in Python and rewrite it in a more "Pythonic" way. Explain why the Pythonic version is preferred. Original code: `for i in range(len(my_list)): print(my_list[i])`
Explain what a decorator is in Python. Write a simple decorator called `@timer` that measures the execution time of any function it decorates and prints the duration to the console. Show how to apply this decorator to a sample function.
Build a robust data cleaning pipeline for a messy CSV dataset. Requirements: 1. Handle missing values using forward-fill, backward-fill, and mean imputation strategies. 2. Detect and remove outliers using IQR method. 3. Standardize date formats across multiple columns. 4. Remove duplicate rows based on composite keys. 5. Generate a data quality report showing before/after statistics. Use pandas best practices with method chaining for readability.