[Python] Resolve infinite time for parquet file loading in pandas

Discussão em 'Python' iniciado por Stack, Junho 3, 2025.

  1. Stack

    Stack Membro Participativo

    !python -V #%% import pandas as pd import pickle from sklearn.metrics import root_mean_squared_error from sklearn.feature_extraction import DictVectorizer import mlflow

    def read_dataframe1(filename): df = pd.read_parquet(filename)

    df['duration'] = df.tpep_dropoff_datetime - df.tpep_pickup_datetime
    df.duration = df.duration.apply(lambda td: td.total_seconds()/60)

    df = df[df.duration >= 1] & (df.duration <= 60)

    categorical = ['PULocationID', 'DOLocationID']
    df[categorical] = df[categorical].astype(str)

    return df


    #%% train_df = read_dataframe1("https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2023-01.parquet")

    When I run the last line for loading the parquet file with the function read_dataframe1, it does not load even after waiting over 30 minutes and the cell keeps running

    What can be the reason?

    Continue reading...

Compartilhe esta Página