Differences from pandas
pandasx is tested against pandas 3 with a parity suite that runs the same operations in both and compares the results. The behaviours below differ on purpose, or because JavaScript works differently. For the syntax mapping (operators, [], keyword arguments) see Coming from pandas.
Language-level
- Methods instead of operators and
[].s.add(t),df.get('a'),df.set('c', v),df.loc(...),df.setLoc(...): JavaScript has no operator overloading or item assignment. - Asynchronous binary I/O. Excel, Parquet, Feather, HDF5 and SQL return a
Promise, because the libraries underneath are asynchronous. CSV, JSON, HTML and XML are synchronous, with…Asyncvariants for URLs. - Row-wise
applyreceives a plain object, not a Series. - Missing values. Numbers use
NaN; strings, dates, objects and the nullable dtypes (Int64,Float64,boolean) read back asnull, which is whatpd.NAis. There is no separateNaTobject: a missing datetime isnull. - Datetime resolution is milliseconds, the resolution of JavaScript
Date. Nanosecond timestamps from files are truncated to milliseconds, and pandas reads datetimes written by pandasx asdatetime64[ms]. - Booleans print as
true/falseinconsole.log. Exports (CSV, HTML, XML) writeTrue/Falselike pandas.
Data model
- Column labels are unique strings. Duplicate column names throw instead of being allowed. A MultiIndex column is a tuple of strings:
df.columnIndexholds the tuples,df.columnsthe parts joined by\u001f, andflattenColumns()turns them into names likeprice_min. - Row labels can be strings, numbers, booleans, dates,
nullor tuples (a MultiIndex).
Plotting
- SVG instead of Matplotlib. Charts are SVG strings with a fixed, colour-blind-safe visual system, not a Matplotlib figure.
- No secondary y axis. Two scales on one chart mislead readers; use
subplots: true. - At most eight series per chart. More would need repeated colours, so the call throws; select fewer columns or use
subplots. Pie charts fold extra slices into "Other".
Numerics
- Weighted rolling
std/var(rolling(n, { winType }).std()) slide the weights with the window, consistent with the weightedmean. pandas assigns them by absolute position. interpolate({ method: 'pad' })is still accepted as an alias forffill; pandas 3 removed it.
Files
- HDF5: writing uses the
tableformat and does not support MultiIndex rows yet; reading supports bothfixedandtable. - Parquet: categorical columns read back in pandas as strings.
Something else behaves differently? It is probably a bug: please open an issue with the pandas code and the pandasx code side by side.