Giter Club home page Giter Club logo

Comments (4)

Aloqeely avatar Aloqeely commented on June 25, 2024

Thanks for the report! In the example you provided, print(len(a)) outputs 1425 elements and print(len(d)) also outputs 1425 so nothing is being cutoff for me, could you double check if this example works or not?

from pandas.

chaoyihu avatar chaoyihu commented on June 25, 2024

Excel has a hard limit on the size of the contents in a single cell: up to 32,767 characters:

https://github.com/pandas-dev/pandas/blob/main/pandas/io/excel/_base.py#L1360

The example provided actually works, because the length of a - converted to a string - is right at the 32,767 limit. It breaks if you add another value, in which case the user will get the warning in the code above.

In that case, Excel will cut off the list right at the limit, and it seems @josemariagarcia95 suggests that the Pandas Excel writer should gracefully truncate the written data to fit the maximum Excel cell size.

However, it seems like a pathological use case of the Excel writer, because it's not normal to try to store an entire large data series in a single Excel cell; the point of Excel is to save structured data, so the more reasonable way to use it would be to write the series as a proper Excel column, by replacing the line:

b.loc[0] = [a]

with

b['a'] = a

which works perfectly.

from pandas.

asishm avatar asishm commented on June 25, 2024

Can be closed as a duplicate of #56954 This is a known Excel limitation so round-tripping is not possible here. This is going to warn in pandas 3.0 (see the linked PR of that issue).

from pandas.

josemariagarcia95 avatar josemariagarcia95 commented on June 25, 2024

I wasn't aware of the Excel limitation, sorry for the disturbance and thank you all for the help!

@chaoyihu that structure comes from a DB in my company where each row holds information about a physical signal and the column "Value" contains a huge array with all the values that were read for that signal during a short period of time (I think it's a couple of seconds but it's a high-frequency signal). I was hoping to export it to Excel so non-technies colleagues could open certain snapshots I provide them with using Excel (since the alternative was to handle them really big CSV files that they would open with a regular Notebook app and that would traumatize them instantly).

Again, sorry for the misunderstanding. Thanks!

from pandas.

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.