Using Apply and Map in Pandas for Keras (2.4)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 5

  • @MattRosinski
    @MattRosinski 2 ปีที่แล้ว +1

    The example pandas syntax of using apply with dataframes is overly complex for the specific example of calculating a new efficiency feature. Instead of:
    efficiency = df.apply(lambda x: x['displacement']/x['horsepower'], axis=1)
    df['efficiency'] = efficiency
    This can be more directly and intuitively coded with something like:
    df["efficiency"] = df["displacement"]/df["horsepower"]
    But the purpose of the lesson is to demonstrate how to apply functions over a dataframe so this simple example is really helpful. Your channel is such a valuable resource thanks Jeff!

  • @rchuso
    @rchuso 5 ปีที่แล้ว +3

    Thanks, Jeff.

  • @boscho1986
    @boscho1986 4 ปีที่แล้ว

    I'm getting an error when trying to access the tax-zip code data file:
    URLError:
    Might this have something to do with my location (Europe)?

  • @Skandawin78
    @Skandawin78 5 ปีที่แล้ว

    Although lot these pandas functions are useful, their syntax is not intuitive to use unlike R.
    Not sure, it's only me or others feel the same