Filtering datetime in pivot table
I have a pivot table that looks like this:
From this pivot table, I would like to get the values of only certain dates, from the 3rd of March until the 6th of April for every year.
What would the best way to approach this problem? Thanks!
See also questions close to this topic
-
Will model.predict update a GRU layer states correctly?
This is my first question, suggestions are appreciated!
Background
I built a model similar to this one.
I am using
model.predict(inputs)
to make predictions and I built my custom functions and process to make it learn. It seems to work and when it predicts all seems good.Some days ago, I watched this video: https://youtu.be/8HyCNIVRbSU?t=284 (It starts in the part that generated my question) And I copied the image that caught my attention:
It says that each input is inserted sequentially on each cell, and each cell will provide more information to the next in that order.
I began to wonder if my implementation is correct and I will give you all the details that might be useful.
Details
- I am using
stateful=True
for both GRU layers. - The input at
model.predict(inputs)
is defined likeinputs = [np.array(arr).reshape(1, 1, 6), np.array(arr2).reshape(1, 1, 4)]
. - I have a csv with the values of the first part of the input, but for the other values, I create them on the fly. That is why I used
model.predict
. Because of this, if there is another way to be able to send both the static and "dynamic data", I would be happy to do it. - The only way that I am interacting with the model after loading it is by asking to predict the values, and by updating its weights (and resetting states when I input a new sequence).
Now, with all this information, the question would be:
- Is model.predict updating all the cell states correctly and using thr GRU layer to its full capacity?
- Or is it just sending the data to the first cell always?
- I am using
-
Any Python string method would remove punctuation from a string?
Python method to remove punctuation in a string such that the string "A HAPPY, Happy Year2021 Holidays!!!" will become "A HAPPY Happy Year2021 Holidays"
-
JavaScript / Python is messing up my web request (by manipulating my strings without permission)
I'm trying to make a web request work (for over 12 hours yet) with requests library for Python. The problem is that I have to send some JSON data by a POST request. The data which should be send looks like this:
let container = { data: "{\"rtId\":663528,\"parmtrs\":\"{\\\"firstVisit\\\":false,\\\"requestId\\\":\\\"05e07b82df46499dab3f9f4ba4d932c6\\\",\\\"rememberUserId\\\":\\\"\\\",\\\"lang\\\":\\\"en#US\\\"}\"}" }
(This is JavaScript)
But as soon as I evaluate container.data it becomes like:
{"rtId":663528,"parmtrs":"{\\"firstVisit\\":false, .......
And this results in an invalid request (because there should be three dashes \\ in the post body and not just \) - I have to encrypt JSON-String for the post body but if there are more dashes than expected the string becomes invalid.
Neither Python nor JavaScript works with that, both escaping the strings even when I use something like String.raw (JavaScript) or r"" in Python.
This is both a problem with Python & JavaScript.
I need some good ideas how to get strings that are looking like the first example with three dashes in Python (I also tried to send encoded body string like:
%7B%22rtId%22%3A668%2C%
but this results in a 403 response code (everything ends up in a 403 response code so far. I validated everything for hours: 100% valid & exact cookies and headers) so the problem could only be because of wrong formatted body data within the post request.
I'm at my wits end.
-
does not match format '%Y-%m-%d %H:%M:%S
Can't see the issue with not matching the format.
chDate = [] for value in sheet.iter_cols(min_row=2,min_col=6,max_col=6, values_only=True): chDate.append(str(value)) chDate = [datetime.strptime(d, "%Y-%m-%d %H:%M:%S") for d in chDate]
-
Elixir equivalent for Ruby on Rails time helpers (e.g. 1.day.ago)
I am currently building a Phoenix app and am relatively new to the ecosystem. Having come from Ruby on Rails, I'm quite used to the convenience date/time methods available in rails (through the builtin ActiveSupport Gem I believe). For example:
1.day.ago some_date_time + 1.hour some_date.next_weekday.at_beginning_of_day
I especially appreciate their ability to clearly & concisely express conceptually simple (to humans at least) time operations, while abstracting away the messy date math.
I find the following objectionable
NaiveDateTime.add( NaiveDateTime.utc_now(), Enum.random(-5..-1) * 60 * 60 * 24)
It's not immediately clear & won't handle subtle time caveats like leap seconds/days etc. It's also not immediately clear how I might move forward 1 month or year.
Is there a popular/canon Elixir package that provides similar clarity & power? Bonus points if it's also concise.
-
how to convert datetime format from '2021-01-09T00:00:00' LIKE 2021-01-09 in datatable
I want to show my hours changed from sql to 2021-01-09 00: 00: 00.000 as 2021-01-09. This date is filling up in the datatable, how can I change it?
-
display Excel PivotTable Data Source as cellvalue
I am trying to find a way to display PivotTable Data Source in excel worksheet. I know we can manually view the Data source by clicking on PivotTable Tools Analyze > Change Data Source > Change Data source to display source in a separate window. I would like to know if it is possible dynamically display the source value as text in a linked cell(sample cell F4 below).
It can be one way relationship, meaning changing PivotTable Data Source, the display cell should be automatically updated, but changing the cell value in display cell does not necessary lead to change in PivotTable Data source. (**but if it change be done for both directions, would be even better.)
welcome both VBA and non-VBA solutions.
Any suggestions are much appreciated.
THANK YOU VERY MUCH!
-
excel - is it possible to group dates in a column in pivot table?
I have a table where the columns are months. I want the sum of values grouped by 3 months. I was wondering if this is even possible as the group button is grayed out.
January February March ... 999 999 999 999 999 999 999 999 999
the output should look like
January-March ... 8991
-
Excel PowerPivot Chart get list of possible Filter Items
When using Excel PowerPivot I am aware that I can set the list of visible items in a Chart using MDX-syntax in VBA like:
ActiveChart.PivotLayout.PivotTable.PivotFields( _ "[X1].[X2].[X3]").VisibleItemsList = Array( _ "[X1].[X2].&[202053]", "[X1].[X2].&[202102]")
How can I obtain the list of possible filter values from the powerpivot chart? My goal is to get this list, sort the strings and select the last 10 items and use these strings as the input to
VisibleItemsList = Array(...