|
| 1 | +.. _CTable: |
| 2 | + |
| 3 | +CTable |
| 4 | +====== |
| 5 | + |
| 6 | +A columnar compressed table backed by one :class:`~blosc2.NDArray` per column. |
| 7 | +Each column is stored, compressed, and queried independently; rows are never |
| 8 | +materialised in their entirety unless you explicitly call :meth:`~blosc2.CTable.to_arrow` |
| 9 | +or iterate with :meth:`~blosc2.CTable.__iter__`. |
| 10 | + |
| 11 | +.. currentmodule:: blosc2 |
| 12 | + |
| 13 | +.. autoclass:: CTable |
| 14 | + :members: |
| 15 | + :member-order: groupwise |
| 16 | + |
| 17 | + .. rubric:: Special methods |
| 18 | + |
| 19 | + .. autosummary:: |
| 20 | + |
| 21 | + CTable.__len__ |
| 22 | + CTable.__iter__ |
| 23 | + CTable.__getitem__ |
| 24 | + CTable.__repr__ |
| 25 | + CTable.__str__ |
| 26 | + |
| 27 | + .. automethod:: __len__ |
| 28 | + .. automethod:: __iter__ |
| 29 | + .. automethod:: __getitem__ |
| 30 | + .. automethod:: __repr__ |
| 31 | + .. automethod:: __str__ |
| 32 | + |
| 33 | + |
| 34 | +Construction |
| 35 | +------------ |
| 36 | + |
| 37 | +.. autosummary:: |
| 38 | + |
| 39 | + CTable.__init__ |
| 40 | + CTable.open |
| 41 | + CTable.load |
| 42 | + CTable.from_arrow |
| 43 | + CTable.from_csv |
| 44 | + |
| 45 | +.. automethod:: CTable.__init__ |
| 46 | +.. automethod:: CTable.open |
| 47 | +.. automethod:: CTable.load |
| 48 | +.. automethod:: CTable.from_arrow |
| 49 | +.. automethod:: CTable.from_csv |
| 50 | + |
| 51 | + |
| 52 | +Attributes |
| 53 | +---------- |
| 54 | + |
| 55 | +.. autosummary:: |
| 56 | + |
| 57 | + CTable.col_names |
| 58 | + CTable.nrows |
| 59 | + CTable.ncols |
| 60 | + CTable.cbytes |
| 61 | + CTable.nbytes |
| 62 | + CTable.schema |
| 63 | + CTable.base |
| 64 | + |
| 65 | +.. autoproperty:: CTable.nrows |
| 66 | +.. autoproperty:: CTable.ncols |
| 67 | +.. autoproperty:: CTable.cbytes |
| 68 | +.. autoproperty:: CTable.nbytes |
| 69 | +.. autoproperty:: CTable.schema |
| 70 | + |
| 71 | + |
| 72 | +Inserting data |
| 73 | +-------------- |
| 74 | + |
| 75 | +.. autosummary:: |
| 76 | + |
| 77 | + CTable.append |
| 78 | + CTable.extend |
| 79 | + |
| 80 | +.. automethod:: CTable.append |
| 81 | +.. automethod:: CTable.extend |
| 82 | + |
| 83 | + |
| 84 | +Querying |
| 85 | +-------- |
| 86 | + |
| 87 | +.. autosummary:: |
| 88 | + |
| 89 | + CTable.where |
| 90 | + CTable.select |
| 91 | + CTable.head |
| 92 | + CTable.tail |
| 93 | + CTable.sample |
| 94 | + CTable.sort_by |
| 95 | + |
| 96 | +.. automethod:: CTable.where |
| 97 | +.. automethod:: CTable.select |
| 98 | +.. automethod:: CTable.head |
| 99 | +.. automethod:: CTable.tail |
| 100 | +.. automethod:: CTable.sample |
| 101 | +.. automethod:: CTable.sort_by |
| 102 | + |
| 103 | + |
| 104 | +Aggregates & statistics |
| 105 | +----------------------- |
| 106 | + |
| 107 | +.. autosummary:: |
| 108 | + |
| 109 | + CTable.describe |
| 110 | + CTable.cov |
| 111 | + |
| 112 | +.. automethod:: CTable.describe |
| 113 | +.. automethod:: CTable.cov |
| 114 | + |
| 115 | + |
| 116 | +Mutations |
| 117 | +--------- |
| 118 | + |
| 119 | +.. autosummary:: |
| 120 | + |
| 121 | + CTable.delete |
| 122 | + CTable.compact |
| 123 | + CTable.add_column |
| 124 | + CTable.drop_column |
| 125 | + CTable.rename_column |
| 126 | + |
| 127 | +.. automethod:: CTable.delete |
| 128 | +.. automethod:: CTable.compact |
| 129 | +.. automethod:: CTable.add_column |
| 130 | +.. automethod:: CTable.drop_column |
| 131 | +.. automethod:: CTable.rename_column |
| 132 | + |
| 133 | + |
| 134 | +Persistence |
| 135 | +----------- |
| 136 | + |
| 137 | +.. autosummary:: |
| 138 | + |
| 139 | + CTable.save |
| 140 | + CTable.to_csv |
| 141 | + CTable.to_arrow |
| 142 | + |
| 143 | +.. automethod:: CTable.save |
| 144 | +.. automethod:: CTable.to_csv |
| 145 | +.. automethod:: CTable.to_arrow |
| 146 | + |
| 147 | + |
| 148 | +Inspection |
| 149 | +---------- |
| 150 | + |
| 151 | +.. autosummary:: |
| 152 | + |
| 153 | + CTable.info |
| 154 | + CTable.schema_dict |
| 155 | + CTable.column_schema |
| 156 | + |
| 157 | +.. automethod:: CTable.info |
| 158 | +.. automethod:: CTable.schema_dict |
| 159 | +.. automethod:: CTable.column_schema |
| 160 | + |
| 161 | + |
| 162 | +---- |
| 163 | + |
| 164 | +.. _Column: |
| 165 | + |
| 166 | +Column |
| 167 | +====== |
| 168 | + |
| 169 | +A lazy column accessor returned by ``table["col_name"]`` or ``table.col_name``. |
| 170 | +All index operations and aggregates apply the table's tombstone mask |
| 171 | +(``_valid_rows``) so deleted rows are silently excluded. |
| 172 | + |
| 173 | +.. autoclass:: Column |
| 174 | + :members: |
| 175 | + :member-order: groupwise |
| 176 | + |
| 177 | + .. rubric:: Special methods |
| 178 | + |
| 179 | + .. autosummary:: |
| 180 | + |
| 181 | + Column.__len__ |
| 182 | + Column.__iter__ |
| 183 | + Column.__getitem__ |
| 184 | + Column.__setitem__ |
| 185 | + |
| 186 | + .. automethod:: __len__ |
| 187 | + .. automethod:: __iter__ |
| 188 | + .. automethod:: __getitem__ |
| 189 | + .. automethod:: __setitem__ |
| 190 | + |
| 191 | + |
| 192 | +Attributes |
| 193 | +---------- |
| 194 | + |
| 195 | +.. autosummary:: |
| 196 | + |
| 197 | + Column.dtype |
| 198 | + Column.null_value |
| 199 | + |
| 200 | +.. autoproperty:: Column.dtype |
| 201 | +.. autoproperty:: Column.null_value |
| 202 | + |
| 203 | + |
| 204 | +Data access |
| 205 | +----------- |
| 206 | + |
| 207 | +.. autosummary:: |
| 208 | + |
| 209 | + Column.to_numpy |
| 210 | + Column.iter_chunks |
| 211 | + Column.assign |
| 212 | + |
| 213 | +.. automethod:: Column.to_numpy |
| 214 | +.. automethod:: Column.iter_chunks |
| 215 | +.. automethod:: Column.assign |
| 216 | + |
| 217 | + |
| 218 | +Nullable helpers |
| 219 | +---------------- |
| 220 | + |
| 221 | +.. autosummary:: |
| 222 | + |
| 223 | + Column.is_null |
| 224 | + Column.notnull |
| 225 | + Column.null_count |
| 226 | + |
| 227 | +.. automethod:: Column.is_null |
| 228 | +.. automethod:: Column.notnull |
| 229 | +.. automethod:: Column.null_count |
| 230 | + |
| 231 | + |
| 232 | +Unique values |
| 233 | +------------- |
| 234 | + |
| 235 | +.. autosummary:: |
| 236 | + |
| 237 | + Column.unique |
| 238 | + Column.value_counts |
| 239 | + |
| 240 | +.. automethod:: Column.unique |
| 241 | +.. automethod:: Column.value_counts |
| 242 | + |
| 243 | + |
| 244 | +Aggregates |
| 245 | +---------- |
| 246 | + |
| 247 | +Null sentinel values are automatically excluded from all aggregates. |
| 248 | + |
| 249 | +.. autosummary:: |
| 250 | + |
| 251 | + Column.sum |
| 252 | + Column.min |
| 253 | + Column.max |
| 254 | + Column.mean |
| 255 | + Column.std |
| 256 | + Column.any |
| 257 | + Column.all |
| 258 | + |
| 259 | +.. automethod:: Column.sum |
| 260 | +.. automethod:: Column.min |
| 261 | +.. automethod:: Column.max |
| 262 | +.. automethod:: Column.mean |
| 263 | +.. automethod:: Column.std |
| 264 | +.. automethod:: Column.any |
| 265 | +.. automethod:: Column.all |
| 266 | + |
| 267 | + |
| 268 | +---- |
| 269 | + |
| 270 | +.. _SchemaSpecs: |
| 271 | + |
| 272 | +Schema Specs |
| 273 | +============ |
| 274 | + |
| 275 | +Schema specs are passed to :func:`field` to declare a column's type, |
| 276 | +storage constraints, and optional null sentinel. They are also |
| 277 | +available directly in the ``blosc2`` namespace (e.g. ``blosc2.int64``). |
| 278 | + |
| 279 | +.. currentmodule:: blosc2 |
| 280 | + |
| 281 | +.. autofunction:: field |
| 282 | + |
| 283 | +Numeric |
| 284 | +------- |
| 285 | + |
| 286 | +.. autosummary:: |
| 287 | + |
| 288 | + int8 |
| 289 | + int16 |
| 290 | + int32 |
| 291 | + int64 |
| 292 | + uint8 |
| 293 | + uint16 |
| 294 | + uint32 |
| 295 | + uint64 |
| 296 | + float32 |
| 297 | + float64 |
| 298 | + |
| 299 | +.. autoclass:: int8 |
| 300 | +.. autoclass:: int16 |
| 301 | +.. autoclass:: int32 |
| 302 | +.. autoclass:: int64 |
| 303 | +.. autoclass:: uint8 |
| 304 | +.. autoclass:: uint16 |
| 305 | +.. autoclass:: uint32 |
| 306 | +.. autoclass:: uint64 |
| 307 | +.. autoclass:: float32 |
| 308 | +.. autoclass:: float64 |
| 309 | + |
| 310 | +Complex |
| 311 | +------- |
| 312 | + |
| 313 | +.. autosummary:: |
| 314 | + |
| 315 | + complex64 |
| 316 | + complex128 |
| 317 | + |
| 318 | +.. autoclass:: complex64 |
| 319 | +.. autoclass:: complex128 |
| 320 | + |
| 321 | +Boolean |
| 322 | +------- |
| 323 | + |
| 324 | +.. autosummary:: |
| 325 | + |
| 326 | + bool |
| 327 | + |
| 328 | +.. autoclass:: bool |
| 329 | + |
| 330 | +Text & binary |
| 331 | +------------- |
| 332 | + |
| 333 | +.. autosummary:: |
| 334 | + |
| 335 | + string |
| 336 | + bytes |
| 337 | + |
| 338 | +.. autoclass:: string |
| 339 | +.. autoclass:: bytes |
0 commit comments