Skip to content

Tag: python

How to display flask data on URL path

hi I created a simple website to calculate the square of the number. below is the code calculate.html homepage.html python now I want to display input number in URL path. e.g. http://127.0.0.1:3000/square/10 so I’ve tried this but it didn’t work. What could I do? Answer You could get variables dir…

Plotting multiple dataframes in one chart

In the following code, in each iteration a dataframe is read from a dictionary and is plotted. My intention is see all plots in one chart, but I see multiple charts in separate windows. I see some tutorials about that, e.g. here, but it seems that they work when I want to call df.plot() with different columns…

Pipreqs not including all packages?

I currently have a conda environment tf_gpu and I pip installed pipreqs in it to auto generate requirements.txt Now, in my project folder, I have app.py with the imports : Also, predict uses pandas, scipy, numpy, pickle So, but the requirements.txt generated by pipreqs using pipreqs ./ inside the project fold…

isin only returning first line from csv

I’m reading from a sqlite3 db into a df: Then I have a symbols.csv file which I want to use to filter the above df: Here’s how I’ve tried to do it: But for some reason I only get the first line returned from the csv: Where am I going wrong here? Answer You need convert csv file to Series,

EasyOCR Printing file details instead of text output only

I am trying to test out Easy OCR. Now when I run my code It outputs this Instead of just I want to get an simple output but it seems it also prints the image details and such. EDIT: Sorry I posted a wrong output. If anyone is wondering here’s the link of the photo Answer As it is explained

Subset dataframe based on integer in column name

I have a dataframe that has names such as these for its columns: In Python, how can I return a list of only the dataframe columns where the number after the first underscore is greater than 20? Answer We can use a list comprehension with basic string splitting logic: