Recent content by msn009
-
M
Python How to drop rows when there is a length mismatch?
Yes, I agree that it is inefficient to keep posting issues as it appears and I am new to Python. The datasets that I am dealing with are often formatted in different ways so I have to be comfortable with being able to manipulate them according to my needs. I have done a few courses but I find...- msn009
- Post #5
- Forum: Programming and Computer Science
-
M
Python How to drop rows when there is a length mismatch?
Hi, I don't believe my questions were similar as I am dealing with a different dataframe at every point with specific problems that I cannot expect in advance. I am learning while working on these different datasets but I realize that I may be asking too many questions here and to actually have...- msn009
- Post #3
- Forum: Programming and Computer Science
-
M
Python How to drop rows when there is a length mismatch?
I am trying to drop the series size so that it matches the size of the dataframe as I need to copy the index value of the series into the df but I am getting mismatch errors. df has a size of 100 but time has a size of 200 so I want to remove the extra rows in time to match df. how can i handle...- msn009
- Thread
- Drop Length Python
- Replies: 5
- Forum: Programming and Computer Science
-
M
Python How to plot timeseries data in Python
I have a dataframe that looks as attached. What I aiming to do is to plot the lines for each type where if it is for type A, I want to be able to have two lines in the graph that shows the trend for type A. I was not able to find any examples online especially with the format of the data in this...- msn009
- Thread
- Data Plot Python
- Replies: 1
- Forum: Programming and Computer Science
-
M
Python How to calculate rows where it has values in at least 3 columns
thanks. sorry for not explaining the scenario in detail.- msn009
- Post #9
- Forum: Programming and Computer Science
-
M
How to plot timestamps within a row?
sorry, i thought the tag would show python and yes it is in python. but these timestamps are within the row itself and i have several hundred rows with this data inside each. i thought of doing it in python so that i can read the file and plot a chart for each.- msn009
- Post #6
- Forum: Programming and Computer Science
-
M
How to plot timestamps within a row?
i have a dataset that has the timestamp data within each row and I am trying to plot the values to see the distribution but have no idea how to do it if the data is presented this way as attached. any ideas? thanks- msn009
- Thread
- Plot Python Row
- Replies: 7
- Forum: Programming and Computer Science
-
M
Python How to calculate rows where it has values in at least 3 columns
yes they are but in this case there are more than 10 columns which makes it difficult to determine the location of the column using integers.- msn009
- Post #7
- Forum: Programming and Computer Science
-
M
Python How to calculate rows where it has values in at least 3 columns
i wanted to do it this way so that i can select the columns that could be in other position in the dataframe: cols = ['a', 'b', 'c', 'd''] sum(row[cols].count("no_label") < 2 for row in df) but it gives me this error : TypeError: string indices must be integers, not list what can i do to...- msn009
- Post #5
- Forum: Programming and Computer Science
-
M
Python How to calculate rows where it has values in at least 3 columns
thank you for this suggestion. but what if i only want to check from these columns a,b,c, and d? as I have other columns e,f,g that also has the 'no_label' value but I don't want to consider them,- msn009
- Post #3
- Forum: Programming and Computer Science
-
M
Python How to calculate rows where it has values in at least 3 columns
I am trying to count number of rows that has values in at least 3 columns so the output based on the image shared should be 4. I tried using the code below but it is resulting in the same shape as the whole table which is 7. counts = df[(df[['a', 'b', 'c', 'd]] != 'no_label').count(axis=1) >= 3]- msn009
- Thread
- Columns Python
- Replies: 8
- Forum: Programming and Computer Science
-
M
Python Python not recognizing MAX value in a list
yes, totally. adding the word loop there was misleading. thanks for pointing it out.- msn009
- Post #10
- Forum: Programming and Computer Science
-
M
Python Python not recognizing MAX value in a list
you are awesome! thank you so much as just these few lines reduced all those lines significantly. I owe you one!- msn009
- Post #8
- Forum: Programming and Computer Science
-
M
Python Python not recognizing MAX value in a list
below is the complete code considering when there are no duplicates and with duplicates. i would welcome suggestions on how to shorten this whole if else loop :) # if list does not have duplicate values if majority != 0 and (len(list_maj) == len(set(list_maj))): if counter_a == majority...- msn009
- Post #6
- Forum: Programming and Computer Science
-
M
Python Python not recognizing MAX value in a list
it is funny that when i tried this very same code on a windows platform it did not give me any problem but when i ran it on a ubuntu platform, it will just not read that 0.600000001 as the maximum value- msn009
- Post #4
- Forum: Programming and Computer Science