Comments (4)
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.
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.
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.
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)
- BUG: pd.read_sql() converts string "NA" to None HOT 1
- API: timestamp resolution inference - default to one unit (if possible) instead of being data-dependent? HOT 4
- DOC: punctuation of titles in Titanic data HOT 1
- BUG: `unstack` with `sort=False` scrambles data HOT 3
- BUG: pandas.read_parquet fails to read parquet files with "file://" prefix on Windows HOT 2
- BUG: csv date inconsistencies HOT 2
- Potential performance regression with "BUG: DateTimeIndex.is_year_start unexpected behavior when constructed…" HOT 1
- BUG: output of pandas.util.hash_pandas_object() changed in pandas 2.2.x HOT 2
- BUG: docker build on windows fails; need eol=lf in .gitattributes HOT 2
- BUG: None value in MultiIndex can't be found HOT 1
- BUG: HDFStore doesn't save datetime64[s] right HOT 1
- ENH: Pivot Table HOT 1
- ENH: Pandas Tensor Data Type HOT 2
- BUG: Accessing a row with loc recasts dtype and can cause values to change depending on other columns HOT 2
- BUG: Reading large CSV files with `pyarrow` when values contain newline character. HOT 2
- DOC: Link to SPEC 0 instead of NEP 29 HOT 2
- BUG: `to_parquet(engine="fastparquet")` can't handle DataFrame with NumPy array values HOT 1
- ENH: new method `Series.struct.assign` to allow adding sub-fields to a struct
- BUG: sort_values with ascending=False is not doing stable sorting
- QST: This library always worked, except with this specific .sav file, anyone could give me a clue on why?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas.