What are Python pandas equivalents for R functions like str(), summary(), and head()?

后端 未结 7 1064
别跟我提以往
别跟我提以往 2020-11-29 21:26

I\'m only aware of the describe() function. Are there any other functions similar to str(), summary(), and head()?

相关标签:
7条回答
  • 2020-11-29 22:20

    Pandas offers an extensive Comparison with R / R libraries. The most obvious difference is that R prefers functional programming while Pandas is object orientated, with the data frame as the key object. Another difference between R and Python is that Python starts arrays at 0, but R at 1.

    R               | Pandas
    -------------------------------
    summary(df)     | df.describe()
    head(df)        | df.head()
    dim(df)         | df.shape
    slice(df, 1:10) | df.iloc[:9]
    
    0 讨论(0)
提交回复
热议问题