Skip to content

Tag: python

How do I remove a part of a string?

I have a list of cities in the United States (some elements: ‘Midlothian, VA’, ‘Ridley Park, PA’, ‘Johannesberg, CA’, ‘Sylva, NC’, ‘Kewwannee, IL’, ‘Superior, WI’, ‘Brewster, OH’, ‘Stillwater, MN’). I’ve been…

Returning plt.show() on HTML with Python Flask

I’m using Python Flask to take input from a simple html file. The HTML asks the user to input a state and when they do that I would like for the output to be a plot. I have the following code that’s creating the Python Flask but when a user inputs a state, the plot outputs in my Jupyter Notebook