Skip to content

Differences in behaviour between R and python #1

@sangeetabhatia03

Description

@sangeetabhatia03

A chapter on surprises in store for R users when working in python would be useful. This could have subsections on things like indexing etc.
For example, I was just caught out by the following code:

ser = pd.Series([1, 2], dtype='int32')
ser[0:8]

This does not error, not does it fill out the Series but quietly ignores what the user is asking.
Especially annoying with a large Series. I am using ipython in emacs, so there might be some quirks there but I printed a series of length 120, and it helpfully numbered the rows. The last few rows were numbered 150 to 154 but were actually ended in 110.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions