Conducting Data Analysis
Example Prompt:
Example Response:
Related Tasks:
Creating Business Reports
Example Prompt:
Example Response:
Related Tasks:
Designing Data Visualizations
Example Prompt:
Example Response:
import matplotlib.pyplot as plt
import pandas as pd
# Sample data
categories = ['Product A', 'Product B', 'Product C']
sales = [15000, 23000, 18000]
# Create a bar chart
plt.bar(categories, sales, color=['blue', 'orange', 'green'])
plt.title('Sales by Product')
plt.xlabel('Product')
plt.ylabel('Sales ($)')
plt.show()
Related Tasks:
Building Predictive Models
Example Prompt:
Example Response:
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
# Load the dataset
data = pd.read_csv('sales_data.csv')
# Define features and target variable
X = data[['feature1', 'feature2', 'feature3']] # Replace with actual feature names
Y = data['sales']
# Split the data into training and testing sets
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2, random_state=42)
# Create and train the model
model = LinearRegression()
model.fit(X_train, Y_train)
# Make predictions
predictions = model.predict(X_test)
# Evaluate the model
mse = mean_squared_error(Y_test, predictions)
print(f'Mean Squared Error: {mse}')
Related Tasks:
Facilitating Stakeholder Communication
Example Prompt:
Example Response:
Related Tasks: