Giter Site home page Giter Site logo

Altering Data about adjusttext HOT 3 CLOSED

ekwan avatar ekwan commented on June 3, 2024
Altering Data

from adjusttext.

Comments (3)

Phlya avatar Phlya commented on June 3, 2024

Good question, I never tested or checked this purposefully. I wouldn't have expected it to modify the data, but the warning is worrying. I will check at some point... For now just in case you want to be sure, provide the x and y coordinates as copies, I guess.

from adjusttext.

ekwan avatar ekwan commented on June 3, 2024
/Users/kwaneu/sw/miniconda/miniconda3/envs/python/lib/python3.11/site-packages/adjustText/__init__.py:377: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  xp, yp = x[j], y[j]

I have adjustText 0.8 and this was triggered by:

adjust_text(texts, x = df.C, y = df.H)

I can certainly get around this by making copies, but it does look like the underlying df is altered, and with the DeprecationWarning, this behavior doesn't seem optimal.

from adjusttext.

Phlya avatar Phlya commented on June 3, 2024

I just tried it with the latest version from github and didn't get a warning and the data are not altered... So perhaps this is fixed now. Feel free to reopen if you can get reproduce this issue with the master version!

from adjusttext.

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.