Skip to content

Tag: pandas

Remove “.0” from float series

I have a dataframe with values such as 164684564.0 (type is float 64) I just want to remove all the “.0″s from these numbers did not work and https://stackoverflow.com/a/38283006/16796767 did not work either Another thing: I don’t want to convert in scientific numbers (I did it once but I do…

perform df.loc to groupby df

I’ve a df consisted of person, origin and destination the df: I have grouped by the df with df_grouped = df.groupby([‘O’,’D’]) and match them with another dataframe, taxi. similarly, I group by the taxi with their O and D. Then I merged them after aggregating and counting the Per…

Warning while adding rank column to a pandas dataframe

I have derived a dataframe using groupby. I am trying to set a new column ‘rank’ based on the ‘volume’ column using the below code. The code is working but giving a warning – Below is my code. Would appreciate guidance as I am not too much experienced in Python/ Pandas. Answer Be…

how to fix python pandas encoding issue?

I import csv table into JUPYTER NOTEBOOK, and something wrong is happening when I try to iloc a video views column (К-ть переглядів). I need to format this cell to INT type (using .astype()), but it tells me that there is an error: ValueError: invalid literal for int() with base 10: ‘380xa0891xa0555&#82…