Hello Everyone! Thanks for clicking on this video. If you find it difficult to see please please check out this video here where I zoom in on the text kzbin.info/www/bejne/j3bOopSAiL-thMk
@Zenoandturtle Жыл бұрын
Great video. I was after this particular topic.
@brooklynjames44234 жыл бұрын
Very informative! Please make more videos like this.
@chrisbagshaw56764 жыл бұрын
Thanks, awesome video bro!
@joegalbraith15854 жыл бұрын
Great video, thanks.
@Diego_-4 жыл бұрын
thank you!!! simple !
@kofiasante94773 жыл бұрын
How do we sum some rows and not all the rows?
@ChartExplorers3 жыл бұрын
Hi Kofi, We can select which rows we want to sum using iloc. Here is an example df['sum_some_rows'] = df.iloc[0:3].sum(axis=1) Here we just past the index location of the rows that we want to sum to iloc. In the above example we are say get the sum in for rows 0, 1, &, 2 (up to but not including three). If you wanted to sum the last 5 rows we could use .iloc[-5:] or if we wanted to sum rows at index 2 through 6 we could use .iloc[2:7]
@janats87274 жыл бұрын
it's not working for the data loaded from csv.
@ChartExplorers4 жыл бұрын
What error message are you getting?
@ChartExplorers4 жыл бұрын
A common error is *TypeError: can only concatenate str (not "int") to str* . This means that some of your data in the column (or row) that you are trying to sum contains both strings and integers/floats. If this is the case you can convert your column to all numeric values. This video provides a detailed explanation on how to do that kzbin.info/www/bejne/m6euiqyJgbitr80 Once all your values are converted to numeric this TypeError should go away.
@lijithmohanan9284 жыл бұрын
in the fist example, need to know how to add new row at the end and have a sum result
@ChartExplorers4 жыл бұрын
Is this what you are looking for? This will add the column sums as a new row to the end of the DataFrame. df.loc[len(df)] = df.sum(axis=0)
@brendensong80004 жыл бұрын
Great video. Thank you. However, videos are too small to see what you are coding.
@ChartExplorers4 жыл бұрын
Hi Brenden, thanks! I agree it is hard to see if especially if you are not on a computer. I have updated this video with larger text to improve visibility. kzbin.info/www/bejne/j3bOopSAiL-thMk
@ceritamenarikk3 жыл бұрын
screen is too small, have to use microscope
@ChartExplorers3 жыл бұрын
Wow, I'm impressed you could get your screen under a microscope!! 😄 Being serious though, I agree, it is really small. I actually made this updated video that is easier to see kzbin.info/www/bejne/j3bOopSAiL-thMk