I have a model in django that contains a start and end date for a financial year and a value for demand volume. I would like to filter this data on a given date range that may not coincide with the date ranges of the data, taking a proportion of the demand from each data point that may fall somewhere
Tag: python
Trying to select the option
I want to click these option on the pages is there any I am new to a playwright I am not familiar with playwrights so much kindly any solution recommended these is page link https://www.ifep.ro/justice/lawyers/lawyerspanel.aspx Answer You can use the select_options for selecting 30. You can use the text selec…
How to hypertune input shape using keras tuner?
I am trying to hypertune the input shape of an LSTM model based on the different values of timesteps. However, I am facing an issue. While initializing the model, the default value of timesteps (which is 2) is chosen, and accordingly, the build_model.scaled_train is created of shape (4096, 2, 64). Thus the va…
Read multiple csv files with Pandas assign different names
How do I read different csv files in folder without concatenating them but just assigning them with the original file name? For example, file with path …table1.csv will be named “table1” I managed to get all file names how do I read each file now? In other words, instead of reading multiple …
Can I multiply an entire column with a scalar in a dataframe in python?
> Now the problem here is that multiplication of a column with a scaler just multiplies the value in that column to appear multiple times for instance df[L1] = df[L1]*50 will make values of L1 repeat 50 times in the entire column but what I want is to multiply each value in that column to be multiplied by …
An error occured to code like that “argument of type ‘method’ is not iterable”
I would like to predict future stock price and I tried to create calculate function but when I run code below I found an error. I am not sure if I missing (), or not. Could you please advice me? The above is the code and the below is the error shown as below: Answer The issue is with the
Python: how to remove key from list and keep value?
I have an array like this I need result: How can i get sample result? Please help me! Answer You can try a list comprehension – Ouput:
Convert a list of nested dictionary WITH STRING OBJECT into pandas Dataframe
I have a real-time url “linktoAPI” containing a list of nested dictionary. I have tried many solutions from the links below, but none of them helps me achieve what I want. Apparently, it is because the value of the nested dictionary (key: “history_value”) is ununiform and contain long …
Tensorflow dataset, how to concatenate/repeat data within each batch?
If I have the following dataset: dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3, 4, 5, 6]) When I use a batch_size=2, I would get [[1,2], [3,4], [5,6]]. However, I would like to get the following output: [[1,2,1,2], [3,4,3,4], [5,6,5,6]] Basically, I want to repeat the batch dimension by 2x and use thi…
Discord.py bot ignoring channel.message.id
I have a bot that every 1 to 12 hours sends a random message into a specific channel (the channel that the command !random is used in). A certain handful of these message are yes/no questions, and I want to make it that the bot will respond if somebody says yes/no. The code works, the issue is I want the