1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Bug? Can't convert object to strings after updating Anaconda (Jupyter Notebook)...

Discussão em 'Python' iniciado por Stack, Outubro 4, 2024 às 22:22.

  1. Stack

    Stack Membro Participativo

    So I am following along a class and have managed to convert my other columns into what they need to be, however when trying to change my column 'Country' which is listed as object into a string, I just don't get the desired output (in fact I get no output).

    transaction_df['Country'] = transaction_df['Country'].astype(str)


    Doesn't seem to do anything, which I suppose is better than getting an error (..right? Help!)

    No matter what I do, my output when I try transaction_df.dtypes is always as you see below. What am I doing wrong?

    CustomerID int64
    InvoiceNo int64
    AmountSpent float64
    InvoiceDate datetime64[ns]
    Country object
    dtype: object


    If it helps the dataset was large and I had to add a condition of low_memory= False when getting the data.

    New to all this. tx

    Continue reading...

Compartilhe esta Página