i am trying to connet my style.css in django template using the static files {% static ‘assets/css/style.css’ %} but i keep seeing this error Refused to apply style from ‘http://127.0.0.1:8000/assets/css/style.css’ because its MIME type (‘text/html’) is not a supported styl…
Tag: python
Comparing Two dataframes of pandas on the basis of condition of two columns
I have two dataframe in which columns are different, And I need to search and the map the data in new file. I am sharing the dataframes and also desired output DF1 DF2 Now I need to a output from above two dataframes. Conditions Need to search Ref.Y in STR2, if available then pick the “Type” for o…
math domain error doesnt add up using various trig functions with variable
so I am new to python, im using it for a couple classes, I am making programs to run calculations. here I have my code for 3 dimensional vectors, I ran into an issue however when I input a vector with Fx=0 Fy=-6 and Fz=8, it gave me a math domain error when computing the variable s. I tried the
Cannot add private python dependency to cloud function
I am trying to deploy a python cloud function on GCP, using a python package pushed on the artifact registry of another project. I followed the instructions off the google cloud documentation: The service account that deploys the cloudbuild has the role: Artifact Registry Reader The error in cloudbuild: the r…
How to delete empty spaces from pandas DataFrame rows until first populated field?
Lets say I imported a really messy data from a PFD and I´m cleaning it. I have something like this: Name Type Date other1 other2 other3 Name1 ” ” Type1 ” Date1 Name2 ” ” ” Type2 Date2 Name3 ” ” Type3 Date3 ” Name4 ” Type4 ” ” Date4 Name5 …
Collect data from multiple files in a folder and save it as a variable
I want to collect the data from the first line in each .txt file, all the files are in the same folder. I then want to save it in the variable: (addPlayer) This will be needed to add items to a pqt5 list Folder directory: C:UsersHendreOneDriveDocumentsCourseWorkProjectPlayers Code: Answer I think that will he…
Python Dataframe find closest matching value with a tolerance
I have a data frame consisting of lists as elements. I want to find the closest matching values within a percentage of a given value. My code: Present solution: Expected solution: Answer Idea is get difference with val and then replace to missing values if not match tolerance, last get np.nanargmin which rais…
Transforming data using Python Pandas (or M) in Power Query for PowerBi
I have some data about projects I would like to transform in a way that makes it easier to analyse with PowerBi. The data looks like this: Project Number Project Name Planned Start Date SM1 SM2 SM3 10000 A Apr-21 10 20 30 10001 B Jun-21 40 50 60 10002 C Sep-22 70 80 90 The so called ‘SavingMonths’…
Converting .py files to .ipynb
My organisation converts any Jupyter Notebooks (.ipynb files) it makes into python scripts (.py files) for easier management in our repos. I need to convert them back so I can run the notebooks but can’t work out how. I believe they’ve been encoded using the nbconvert package but I couldn’t …
Plotting time series directly with Pandas
In the above dataframe, all I want to create a line plot so that we have info on trends per year for each of the columns. I’ve read about pivot-table on related posts, but when I implement that, it says there are no numbers to aggregate. I don’t want to aggregate something. I just need the y-axis …