Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MicroDataFrame
✓ from microdf import MicroDataFrame
✗ import microdf; microdf.MicroDataFrame
Common mistake: importing the package instead of the class, causing AttributeError or verbose usage.
MicroSeries
✓ from microdf import MicroSeries
Create a MicroDataFrame with a weight column and compute a weighted mean.
import pandas as pd
from microdf import MicroDataFrame
df = pd.DataFrame({
'var1': [1, 2, 3, 4, 5],
'weight': [0.5, 1.0, 1.5, 0.5, 2.0]
})
mdf = MicroDataFrame(df, weights='weight', weight_name='weight')
print(mdf.weighted_mean('var1'))
Errors
Common errors & fixes
AttributeError: module 'microdf' has no attribute 'MicroDataFrame'
User imported the module incorrectly: `import microdf` then `microdf.MicroDataFrame` may fail if __init__.py doesn't export directly (but in this version it does, this error may happen if using old version or typo).
fixUse `from microdf import MicroDataFrame`.
TypeError: __init__() missing 1 required positional argument: 'weight_name'
MicroDataFrame constructor requires `weight_name` parameter since v1.0.0.
fixProvide the `weight_name` argument: `MicroDataFrame(df, weights='w', weight_name='w')`.
ValueError: Weights column not found in DataFrame
The column name passed to `weights` or `weight_name` does not exist in the DataFrame.
fixEnsure the weight column is present and spelled correctly (case-sensitive).
Upgrade
Version history
1.3.0latest on PyPI · released Apr 17, 2026
Audit
Dependencies
pandasrequiredCore dependency for DataFrame operations.
numpyrequiredUsed internally for weighted calculations.
Resources
No resource links recorded.