Highest count in a data frame pandas - pandas

I'm trying to extract 10 columns from a csv file with pandas in Google colab so I'm using this line firstten = data.iloc[:, 0:10] # first ten columns of data frame with all rows
After that I used firstten.count() to count the number of values in each column so after that what I want to know is that if in one of those columns have 80 different values and the others are lower I want to know from this ten columns the highest number of counts for that, I used the max but it didn't work some help with this please I don't need to know which column just the number in some pieces of data will be repeated 80 like 4 times so also to have this in mind with the solution. Also I thought about using the sort function but maybe there is another option.
Thanks for your help this is the output that I would like to get:

Related

Splitting data into new columns

I was wondering if anyone could advise me on a problem I am having with 'r'.
I am working on a drug trial of sorts, with data from 3 experimental conditions.
For every participant, six data points were collected. Meaning each participant is represented on one row, with 6 columns of data points.
However I am now trying to create a 3 level longitudinal model, but in order to do so I need to reformat my data so that instead of each participant having one row with 6 columns, there will be 6 rows for one participant, with two columns, one indicating the round of data collection (1-6), and the other giving the actual value.
Is there a straightforward way to do this? I am hoping I won't be stuck manually reformatting my data, as it will cost me a lot of time that I'd rather invest into analysing the results.
I will also need to combine all three data frames into one main data frame to run the model, but I assume this will be an easy step once I figure out the first problem.

Machine Learning - Feature Generation using dataframes with different sizes

I have multiple CSV files with 18 columns of sensordata of a production cycle ordered by time. Each CSV file represents one product (smartphone), which production was either sucessful (1) or unsucessful (0). I converted each CSV to a dataframe and brought them together in a dictionary. The CSV files have different numbers of rows.
My question is now, if I do have to compress them into one single row with the result of either 1 or 0 at the end to compare different machine learning algorithm (like the multiple logistic regression). For my algorithm, each input is a dataframe, and the output is a label. Concatenating all the rows side by side into one single row could create feature vectors of different lengths.
For example: I have 7 CSV files converted into 7 dataframes and put them together in one dataframe with 7 rows (a single row for every dataframe).
If I have to compresss one DataFrame to a single row, could you tell me how to do so?
Or is it possible to tell the algorithm, that it has to consider every row of a whole dataframe (30000 rows).
Thank you very much!

Find number combination in every row in excel

I have ten column and multiple rows in one Excel sheet with numbers in it. How could I let VBA find all the combination in every row and add the number for all rows.
For example, there is A2:100 and D2:7; C9:7 and F9:100 then it will output a format like 100+7:2
These steps should help get started. Unless you are talking about every possible combination of the number, which is a far more complex topic. You should try to write something and then edit your question to include your code.
Loop the columns For i = 1 to 10
Range(Cells(1, i),Cells(10,i)).Address(False,False) : e.g. A1:A10
WorkSheetFunction.Sum(Range(Cells(1, i),Cells(10,i)).Address(False,False)): 100

Checking for same value in rows and calculate corresponding total

I have a large s/sheet. Values in column A correspond to values in column B, C & D.
I need to combine some rows which have same value in column A and automatically calculates total of value in column B in all corresponding rows.
Then i need to delete all unnecessary rows
Any ideas how i can do this with some code?
I think that you can use Power Query or VBA. Probably you will be able to achieve this with formulas, but it will be not flexible. With Power QUery you can combine data from multiple sources, clean and transform and even load directly into PowerPivot model. If you will have some detailed information please let me know. If you can upload the sample workbook with your data i will be able to provide you some more information.

Combining data from different columns into a line graph with SSRS

Hi I am new to SSRS and I am trying to create a line graph from the following dataset that has a single line and I am confused with how to achieve this simple task.
column1|column2|column3
1,11,35
If I try and add column 1-3 as values it will show nothing because it is trying to do a separate line per column.
I have tried making a temp table in sql and reformatting it as follows:
values
1
11
35
This works however this causes me to lose the axis names for each value.
How can I achieve a single line in my line graph as well as keeping the axis names?
You're correct in that you need separate rows (i.e. pivoting your data) to meet your chart requirements.
You can need to add another column to your new Dataset to have group names, too:
Just example names, obviously.
In your chart, add the Series and Category as required:
Now you have labels on the axis: