Categories
Mastering Development

Split dataframe with all values in one row

I got the following dataframe which is created dynamically but saves all the relevant values into one row: df +—————-+—————-+—————-+—————-+ | 1 | 2 | 3 | 4 | +—————-+—————-+—————-+—————-+ | a1, b1, c1, d1 | a2, b2, c2, d2 | a3, b3, c3, d3 | a4, b4, c4, d4 | +—————-+—————-+—————-+—————-+ I need to […]

Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
Mastering Development

Filter dataframe by logic

I have this dataframe: MAT MAT_IN SER D8 0 X A1 Yes – 1 X A2 No X 2 X A3 No X 3 X A4 Yes X 4 Y B1 No – 5 Y B2 No – 6 Y B3 No – 7 Y B4 No – 8 Y B5 No – Where I […]

Categories
Mastering Development

Can I create a SQL database schema where instead of having primary keys, I create new tables for each scenario ? What are its disadvantages?

For example – If I need 3 tables for my app – A,B and C. When creating a new scenario/record instead of inserting a new row, I create a set of 3 new tables – A2,B2,C2 Next time when I create a new scenario, I create set of 3 new tables A3,B3,C3 and so on. […]

Categories
Mastering Development

pandas groupby condition with exclusion condition inside a group

input DataFrame — >> output–>> I want to aggregate this DataFrame in such a way that for the common value of column A, I have to ignore the only current value of but have to consider all value of B and have to take the sum of column c with respect to the previous condition. […]

Categories
Mastering Development

Why is the Excel DateDif function returning 0 months for dates between “4/30/2020” and “3/31/2020”?

Microsoft says the DateDif function: DATEDIF(A3,B3,"M") returns the full number of months between those two dates assuming A3 = Starting month and B3 = Ending month. However, for dates between 4/30/2020 and 3/31/2020, I am getting a value of 0. I was expecting to get a value of 1. DateDif between 3/1/2020 and 5/31/2020 returns […]

Categories
Mastering Development

multiselect dropdown with dependent listbox

I am trying to create a drop down that is dependent on the selections made of another drop down menu that is multi-select.  E.g. In first drop-down the person has the choice of A, B, C, D, E or F  so if the person selects let’s say A and E. And i want another drop […]

Categories
Mastering Development

How to make custom code in python utilize GPU while using Pytorch tensors and matrice functions

I’ve created a CNN from scratch only using Pytorch tensors and matrix operation functions in the hope of utilizing GPU. To my surprise, the GPU stays 0% utilized and my training doesn’t seem to be faster than running on my cpu. CODE: import operator from pathlib import Path from IPython.core.debugger import set_trace from fastai import […]

Categories
Mastering Development

how to concat and combine two rdd into one in PySpark

I get two RDD and want to concat and combine into one RDD as follows: rdd_1 = [‘a1’, ‘a2’, ‘a3’, ‘a4’, ‘a5’, ] rdd_2 = [‘b1’, ‘b2’, ‘b3’, ‘b4’, ‘b5’, ] # concat and combine these two rdd into one rdd = [‘a1_b1’, ‘a2_b2’, ‘a3_b3’, ‘a4_b4’, ‘a5_b5’] I know I could convert these two RDD […]

Categories
User Help

How to Integrate INDIRECT with SUMIFS

I have several sheets of customers in excel, In summary sheet I want to show sale between date range, ”’ =SUMIFS(‘Riaz Haider’!$B$5:$B$71,’Riaz Haider’!$A$5:$A$71,">="&B3,’Riaz Haider’!$A$5:$A$71,"<="&D3) It is working properly but as you notice here I have used sheet name. But I want to incorporate cell no for example A5 instead of sheet name, as I have […]