I would like to use a different version of Python (3.8.0) and a dedicated virtual environment in a subfolder of a VSC project/work space. Is this possible? Any pointers would be very much appreciated. Thus far U tried to follow this using pyenv. I ran: in the VSC terminal but when I run: I still get: Is there…
Tag: python
If elif else for python confused
So I’m struggling to get down the coding for an assignment I’m doing I’ve tried so many different ways but I can’t get the code to run correctly. At first, the first section was running fine but then I moved on to the brand’s second model and noticed even if I put the color in correctly the result was t…
How to plot scatter graph with SCATTER fill_between in Python?
I am a manufacturing engineer, very new to Python and Matplotlib. Currently, I am trying to plot a scatter time graph, where for every single record, I have the data (read from a sensor) and upper and lower limits for that data that will stop the tool if data is not between them. So for a simple set of data
Splitting list in two new lists python [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago. Improve this question in Python I have a list with 96 entries, some are positiv, some are negative. I now want to…
Matplotlib lock ylim so it can’t be adjusted while panning in UI
I have subplots whose ylims I want to keep locked, so I can scroll through them using matplotlib’s UI. I just want to pan through in the x direction, but sometimes I accidentally pan up/down so that the data pans off screen. Here is an example of an oops: What can I do so this doesn’t happen? I se…
How to find the most frequent appearence in one column for different values in a different column of a grouped dataframe?
The question is not so clear I guess, so here is an example: given a dataframe: company_name company_size company_acitivity 7 eleven 5 restaurant 7 eleven 5 supermarket 7 eleven 10 supermarket goldman sachs 100 bank goldman sachs 200 restaurant goldman sachs 200 bank I want to group the dataframe by company n…
NoReverseMatch at /login/ Reverse for ” not found. ” is not a valid view function or pattern nam
I don’t know why this problem is occuring. The login page is being rendered fine. But when I am clicking the Log In button after filling out the forms, I am getting this error. Can anyone help me solve this? My settings.py: My urls.py: My login.html file: Answer You’ve specified LOGIN_REDIRECT_URL…
Variable file name breaks excel sheet creation
I’ve a code which creates an excel in a specific field with 3 sheets: I need the file name to become a varaible and I’ve done this: Even though the file_name is variable now, I get an error with the sheets creation and It’s blowing my mind. Any other way to make it variable? Thanks Answer Us…
Django get data from related model which has the FK
how can i make this queryset: models with Property.objects.all() I can see in the returned object that there is a listing_set let say: but it brings the entire model, and not the related to property_id; also tried to get Ota data in serializer with SerializerMethodField and perform a new query to get this inf…
Read through a text file and output to a dataframe by Python
I have an text file as below format. I want to read through all the records in the file and output in a dataframe. Expected output: There will be two types of trans description. Code I am trying as below, but it only works for one line of the text file. How can I modify to read through all the