Giter VIP home page Giter VIP logo

Comments (1)

jcrist avatar jcrist commented on May 15, 2024

Looks like this is related to what happens to the index when sort_values is called on a series. On a dataframe the index is kept, but on a series it's dropped and replaced with 0..len(series).

In [1]: import pandas as pd, pygdf as gd

In [2]: df = pd.DataFrame({'x': range(100), 'y': list(map(float, range(100)))})

In [3]: gdf = gd.DataFrame.from_pandas(df)

In [4]: p = gdf[10:20]

In [5]: p
Out[5]:
      x    y
10   10 10.0
11   11 11.0
12   12 12.0
13   13 13.0
14   14 14.0
15   15 15.0
16   16 16.0
17   17 17.0
18   18 18.0
19   19 19.0

In [6]: p.sort_values('x')
Out[6]:
      x    y
10   10 10.0
11   11 11.0
12   12 12.0
13   13 13.0
14   14 14.0
15   15 15.0
16   16 16.0
17   17 17.0
18   18 18.0
19   19 19.0

In [7]: x = p.x

In [8]: x.sort_values()
Out[8]:

 0   10
 1   11
 2   12
 3   13
 4   14
 5   15
 6   16
 7   17
 8   18
 9   19

from cudf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.