I am trying to classify the fashion_mnistdataset using the Conv2D layer and as I know it can be easily done using the following code: However, I am required to not use Lambda layer. so, the above solution is not correct. So, I am wondering, how can i classify the mnist_fashion dataset without using Lambda lay…
Tag: python
‘conda update –all’ yields different results on different machines
‘conda update -all’ yields different results on different machines: Old HP Laptop/Win10 ca 2007, fresh install of miniconda and a few packages, and update-all a few days ago. Versions: pandas, numpy, numba: (‘1.4.1’, ‘1.20.3’, ‘0.54.1’) Python 3.9.12 ipython 8.2…
How to trigger async job from a Cloud Function
I have a Cloud Function (Python) which is triggered by http from web client, it has to calculate something and respond FAST. I would like to save the http request parameters into a database (for analytics). If i just initiate a WRITE to my postgresql, the function will have to wait for it, and it will be slow…
Using .withColumn on all remaining columns in DF
I want to anonymize or replace almost all columns in a pyspark dataframe except a few ones. I know its possible to do something like: However, doing this for all columns is a tedious process. I would rather want to do something along the lines of this: This does however not seem to work. Is there other work a…
Split column to multiple columns by another column value (complicated separator)
I have dataframe like: len of column1 value may be different – from 2 to 5 words, so split with space not an option. Output should be like: That topic – How to split a dataframe string column into two columns? – didn’t help coz of separator UPD. Left “side” may have 2-5 wor…
Django forms.Form reflecting property field constraints
I’m implementing a Django Form witch should contain the field ‘fieldA’ from modelA: My question is: Is there a way to have Django form, which will automatically handle validation of fieldA (check the max_length)? I know I Could use form.ModelFormclass referring to ModelA, but then the form w…
How can I combine different dataframes into one csv in Python?
I have 2 dataframes with different columns. And I want to combine those into 1 csv file. Both headers should be included and there shouldn’t be empty value if columns aren’t matched. I tried to use pd.concat, but I need the result to be like below: Answer You can do this using Pandas to_csv and se…
Python Regex to split a string opening and closing hours [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 days ago. Improve this question I have a string which contains two shifts opening and closing time for each…
Can’t not update the textbox when clicked the optionmenu
I’m trying to display my selection in the optionmenu to the textbox. Could anyone help me with this one? when I clicked one option in the optionmenu, the textbox didn’t update. Here is my code. Answer If you run the code in a terminal, then you should see there is exception when an item is selecte…
Change order of numbers in x tick labels matplotlib
I have averaged a year’s worth of hourly data to one day. As such I have an array representing the hour of day, and another with the data. I want to plot this, however I want to plot it from 12pm to 11am, rather than from midnight to midnight. Matplotlib doesn’t seem to let me change the x axis to