Categories
Mastering Development

why my appended list is overwriting I mean the previous appended element is changing?Can I know why

I tried this code created a function and again callimg the same fuction until x<5 def appen(m,x): print(m) l1.append(m) print(l1) while(x<5): m.append(x) appen(m,x+1) break; input for the above function i/p :input n=[] l1=[] appen(n,1) Actual output o/p [] [[]] [1] [[1], [1]] [1, 2] [[1, 2], [1, 2], [1, 2]] [1, 2, 3] [[1, 2, […]

Categories
Mastering Development

Custom hypothesis testing with Contrast statement in SAS

I have a model that is looking at the impact of a policy exposure, exposure period, and race on surgery rates. Each of the first three variables (exposure=E, period=P, and race=R) are dichotomous (0/1) variables. My regression equation is: y = b(0) + b1P + b2E + b3R + b4EP + b5PR + b6ER + […]

Categories
Mastering Development

Separate data with substring and findstring

I have a problem I think it’s something simple but I’m just getting started on this, I have a .txt file that contains Kayle;Osvorn;35;4399900433 what would be these my columns, (First name;Last name;Age;Phone) I need to separate them through the process of transformation of the derived column into ETL but for now only the first […]

Categories
Mastering Development

how to calculate the scatter within classes for a 50×20 matrix

I am trying to reduce a largely dimentional matrix to only 2D, i was using an example for 2D arrays,which works, but i would need to do the same for a higher dimentional scatter. I have two classes and each classes have matrices of 50×20 dimensional feature spaces. For my example i have these 2D […]

Categories
Mastering Development

Plotting a heatmap or colormap with interpolation in Python

I need to create a ‘heatmap’ or ‘colormap’ in python. I have three python list, namely: X_COORDINATE, Z_COORDINATE and C_I. The X_COORDINATE and Z_COORDINATE lists contain the x and z coordinates that I have specific data points for (stored in the C_I list). The C_I list contains the values that I need to plot onto […]

Categories
Mastering Development

How to print a 2D array of class module type to a range in Excel VBA?

I have a class module called LotData that defines 12 public variables. I then create an array called Buys() of type LotData and fill it with numBuys items. (0 to numBuys -1) I’m having trouble printing Buys() to a range. I’ve seen a few examples here that make it seem easy, but I keep running […]

Categories
Mastering Development

print array as a matrix by having all elements in the right columns

I am trying to print my dataframe as a matrix. To do so, I want to use an array. To be clear: I have a dictionary, Y, which is like this: {(0, 0): {(0, 0): 0, (1, 0): 1, (0, 1): 1, (0, 2): 2, (0, 3): 3, (1, 3): 4, (0, 4): 10, (1, […]

Categories
Apple User Help

Late 2012 iMac – Thunderbolt : no hardware was found

I have an Late 2012 27″ iMac (iMac13,2) and somehow when looking in system report for the Thunderbolt ports say “no hardware was found.” I have tried: Endless searching to find a solution Resetting SMC and NVRAM Updating OS to High Sierra Clean Install, deleting HD and installing High Sierra Clean Install, with 2nd level […]

Categories
Mastering Development

How to multiply elements in an array with each elements in another array using Python

I need help for my project. I have two arrays wherein I have to multiply the elements of array1 for each elements in array2. As an example, pop_i = [[1, 0, 1] [0, 0, 1] [1, 1, 0]] r_q = [[3, 5, 2], [5, 4, 3], [5, 2, 2]] What I did first is to […]

Categories
Mastering Development

Can we fetch data from Kafka from specific offset in spark structured streaming batch mode

In kafka I get new topics dynamically and I have to process it using spark streaming from a specific offset. Is there a possibility to pass the json value from a variable. For example consider the below code val df = spark .read .format(“kafka”) .option(“kafka.bootstrap.servers”, “host1:port1,host2:port2”) .option(“subscribe”, “topic1,topic2”) .option(“startingOffsets”, “””{“topic1”:{“0″:23,”1″:-2},”topic2”:{“0″:-2}}”””) .load() In this I want […]