Python Data Analysis Script
Get Copilot to write a robust data analysis script using Pandas and Matplotlib.
Est. 2 mins
335 characters
9,200 views
prompt.txt
Write a Python script using pandas and matplotlib to load a CSV file named 'data.csv'. The script should clean the data by dropping rows with missing values, calculate the summary statistics for the numeric columns, and generate a bar chart showing the top 10 categories in the 'Category' column. Save the chart as a PNG file.
Use Cases
- •Automating data reports
- •Exploratory data analysis
- •Academic research parsing
Benefits
- •Writes error-free boilerplate code
- •Handles library imports automatically
- •Sets up charting logic instantly
Example Usage
Input Variables
(Just use the prompt directly in Copilot or Cursor)
Expected Output
"A complete, runnable Python script with pandas and matplotlib imports, data cleaning steps, and chart exporting."
Pro Tips for this Prompt
- →Ensure your CSV actually has a "Category" column, or adjust the prompt to match your schema.
Frequently Asked Questions
Will this run in Jupyter Notebooks?
Yes, but you may need to remove the `plt.savefig()` and add `%matplotlib inline` if you want it rendered inside the notebook.