I’ve been given a few sets of MS-Excel worksheets with a lot of nested data in areas, and I have researching for a few hours looking for a way to reduce each ‘id’ row to single rows. Specifically merging ‘Step ID’, ‘Install Steps’, and ‘Expected step’ into…
How can I retrieve a list of values in an array that has same name but different version? [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 1 year ago. Improve this question For example if I have a list: if I have to retrieve just the nameoffile1 ba…
How to use string symbols like x,y as undefined variable in calculations in Python?
I will try to explain what I want to do: I will some polynomial approximation calculations in Python. And my aim is not to use numbers. I want to work with the symbols like x,y,c etc. But I couldn’t find any way to use them in calculations. Simply I want to do that: These x and y are my variables
How to loop over sub-directories within a root directory using os.walk()?
I have a root directory termed “2013” with some subdirectories as follows: what I intend to do is to use os.walk() to go through the innermost sub-directories (i.e., ANAR) and create a similar folder within them if it does not exist already. Here is my code: but I encounter the following error (cr…
How to sort a dataframe with strings
I got an code running that imports an excel file, and i want to be able to sort some of the data in it and write it to a new excel file. I got the code working somewhat as I want, but can’t make it sort the values as wanted… I want to sort the df from the column named
Reshaping MNIST for ResNet50
I am trying to train the mnist dataset on ResNet50 using the Keras library. The shape of mnist is (28, 28, 1) however resnet50 required the shape to be (32, 32, 3) How can I convert the mnist dataset to the required shape? Answer You need to resize the MNIST data set. Note that minimum size actually depends o…
How to split the columns values separated by commas, into multiple rows and also splitting the total revenue by quantity
if u see the screenshot in that f4,f5, and f9 columns values are separated by commas, i want to split that values into different rows, and f9 is a total number of products, so I need to split the revenue as well based on quantity, for example total number of products according to f9 is 5, so total revenue is
how to Read a row starting with a specific integer in text file python?
My problem is that I need to read and print a specific line starting with a specific integer(input by user) from text file. This is my text file information: 1 , ‘USA’ , 7244184 , 53629 , 208440 , 895 2 , ‘Mexico’ , 715457 , 5408 , 75439 , 490 3 , ‘Ireland’ , 33995 , 319 , …
Including the last value in a range loop Python 3
I am having issues trying to get my code to print the last value of the range when I am running a loop. Here is the problem I was given with my code at the end: Here is the output I receive: A B C D E F G H I J K L M N O P Q R
dataframe operations – column attributes to new columns in a new subset dataframe with conditions
I have the dataframe df1 with the columns type, Date and amount. My goal is to create a Dataframe df2 with a subset of dates from df1, in which each type has a column with the amounts of the type as values for the respective date. Input Dataframe: df1 = Desired Output, if the subset of Dates are 2017-02-02 an…