import matplotlib.pyplot as plt x = [1,2,3,4,5] y = [10,20,30,40,50] plt.plot(x, y) # plot x and y values plt.xlabel('X-axis') # set label for x-axis plt.ylabel('Y-axis') # set label for y-axis plt.title('Plotting Example') # set the title for the plot plt.show() # show the plot
import pandas as pd # create a data frame data = {'Name': ['John', 'Mary', 'Jessica'], 'Age': [25, 35, 45], 'City': ['New York', 'Chicago', 'Los Angeles']} df = pd.DataFrame(data) # print the data frame print(df)
from flask import Flask, render_template # create an instance of the Flask class app = Flask(__name__) # define a route and a view function @app.route('/') def hello_world(): return 'Hello, World!' # define a route and a view function that returns a rendered template @app.route('/template') def template_example(): name = 'John' return render_template('index.html', name=name) # run the application if __name__ == '__main__': app.run(debug=True)In these examples, the package library being used is Matplotlib, pandas, and Flask respectively.