Recent content by msn009

  1. 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...
  2. 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...
  3. 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...
  4. M

    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...
  5. M

    Python How to calculate rows where it has values in at least 3 columns

    thanks. sorry for not explaining the scenario in detail.
  6. 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.
  7. 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
  8. 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.
  9. 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...
  10. 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,
  11. 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]
  12. M

    Python not recognizing MAX value in a list

    yes, totally. adding the word loop there was misleading. thanks for pointing it out.
  13. M

    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!
  14. M

    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...
  15. M

    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
Back
Top