Debian Codegraph @

docs/source/dataframe-legacy-api.rst

raw
1 Dask DataFrame API (legacy)
2 ===========================
3
4 .. currentmodule:: dask.dataframe
5
6 Dataframe
7 ~~~~~~~~~
8
9 .. autosummary::
10 :toctree: generated/
11
12 DataFrame
13 DataFrame.abs
14 DataFrame.add
15 DataFrame.align
16 DataFrame.all
17 DataFrame.any
18 DataFrame.apply
19 DataFrame.applymap
20 DataFrame.assign
21 DataFrame.astype
22 DataFrame.bfill
23 DataFrame.categorize
24 DataFrame.columns
25 DataFrame.compute
26 DataFrame.copy
27 DataFrame.corr
28 DataFrame.count
29 DataFrame.cov
30 DataFrame.cummax
31 DataFrame.cummin
32 DataFrame.cumprod
33 DataFrame.cumsum
34 DataFrame.describe
35 DataFrame.diff
36 DataFrame.div
37 DataFrame.divide
38 DataFrame.drop
39 DataFrame.drop_duplicates
40 DataFrame.dropna
41 DataFrame.dtypes
42 DataFrame.eq
43 DataFrame.eval
44 DataFrame.explode
45 DataFrame.ffill
46 DataFrame.fillna
47 DataFrame.first
48 DataFrame.floordiv
49 DataFrame.ge
50 DataFrame.get_partition
51 DataFrame.groupby
52 DataFrame.gt
53 DataFrame.head
54 DataFrame.idxmax
55 DataFrame.idxmin
56 DataFrame.iloc
57 DataFrame.index
58 DataFrame.info
59 DataFrame.isin
60 DataFrame.isna
61 DataFrame.isnull
62 DataFrame.items
63 DataFrame.iterrows
64 DataFrame.itertuples
65 DataFrame.join
66 DataFrame.known_divisions
67 DataFrame.last
68 DataFrame.le
69 DataFrame.loc
70 DataFrame.lt
71 DataFrame.map_partitions
72 DataFrame.mask
73 DataFrame.max
74 DataFrame.mean
75 DataFrame.median
76 DataFrame.median_approximate
77 DataFrame.melt
78 DataFrame.memory_usage
79 DataFrame.memory_usage_per_partition
80 DataFrame.merge
81 DataFrame.min
82 DataFrame.mod
83 DataFrame.mode
84 DataFrame.mul
85 DataFrame.ndim
86 DataFrame.ne
87 DataFrame.nlargest
88 DataFrame.npartitions
89 DataFrame.nsmallest
90 DataFrame.partitions
91 DataFrame.persist
92 DataFrame.pivot_table
93 DataFrame.pop
94 DataFrame.pow
95 DataFrame.prod
96 DataFrame.quantile
97 DataFrame.query
98 DataFrame.radd
99 DataFrame.random_split
100 DataFrame.rdiv
101 DataFrame.reduction
102 DataFrame.rename
103 DataFrame.repartition
104 DataFrame.replace
105 DataFrame.resample
106 DataFrame.reset_index
107 DataFrame.rfloordiv
108 DataFrame.rmod
109 DataFrame.rmul
110 DataFrame.round
111 DataFrame.rpow
112 DataFrame.rsub
113 DataFrame.rtruediv
114 DataFrame.sample
115 DataFrame.select_dtypes
116 DataFrame.sem
117 DataFrame.set_index
118 DataFrame.shape
119 DataFrame.shuffle
120 DataFrame.size
121 DataFrame.sort_values
122 DataFrame.squeeze
123 DataFrame.std
124 DataFrame.sub
125 DataFrame.sum
126 DataFrame.tail
127 DataFrame.to_backend
128 DataFrame.to_bag
129 DataFrame.to_csv
130 DataFrame.to_dask_array
131 DataFrame.to_delayed
132 DataFrame.to_hdf
133 DataFrame.to_html
134 DataFrame.to_json
135 DataFrame.to_parquet
136 DataFrame.to_records
137 DataFrame.to_string
138 DataFrame.to_sql
139 DataFrame.to_timestamp
140 DataFrame.truediv
141 DataFrame.values
142 DataFrame.var
143 DataFrame.visualize
144 DataFrame.where
145
146 Series
147 ~~~~~~
148
149 .. autosummary::
150 :toctree: generated/
151
152 Series
153 Series.add
154 Series.align
155 Series.all
156 Series.any
157 Series.apply
158 Series.astype
159 Series.autocorr
160 Series.between
161 Series.bfill
162 Series.clear_divisions
163 Series.clip
164 Series.compute
165 Series.copy
166 Series.corr
167 Series.count
168 Series.cov
169 Series.cummax
170 Series.cummin
171 Series.cumprod
172 Series.cumsum
173 Series.describe
174 Series.diff
175 Series.div
176 Series.drop_duplicates
177 Series.dropna
178 Series.dtype
179 Series.eq
180 Series.explode
181 Series.ffill
182 Series.fillna
183 Series.first
184 Series.floordiv
185 Series.ge
186 Series.get_partition
187 Series.groupby
188 Series.gt
189 Series.head
190 Series.idxmax
191 Series.idxmin
192 Series.isin
193 Series.isna
194 Series.isnull
195 Series.known_divisions
196 Series.last
197 Series.le
198 Series.loc
199 Series.lt
200 Series.map
201 Series.map_overlap
202 Series.map_partitions
203 Series.mask
204 Series.max
205 Series.mean
206 Series.median
207 Series.median_approximate
208 Series.memory_usage
209 Series.memory_usage_per_partition
210 Series.min
211 Series.mod
212 Series.mul
213 Series.nbytes
214 Series.ndim
215 Series.ne
216 Series.nlargest
217 Series.notnull
218 Series.nsmallest
219 Series.nunique
220 Series.nunique_approx
221 Series.persist
222 Series.pipe
223 Series.pow
224 Series.prod
225 Series.quantile
226 Series.radd
227 Series.random_split
228 Series.rdiv
229 Series.reduction
230 Series.repartition
231 Series.replace
232 Series.rename
233 Series.resample
234 Series.reset_index
235 Series.rolling
236 Series.round
237 Series.sample
238 Series.sem
239 Series.shape
240 Series.shift
241 Series.size
242 Series.std
243 Series.sub
244 Series.sum
245 Series.to_backend
246 Series.to_bag
247 Series.to_csv
248 Series.to_dask_array
249 Series.to_delayed
250 Series.to_frame
251 Series.to_hdf
252 Series.to_string
253 Series.to_timestamp
254 Series.truediv
255 Series.unique
256 Series.value_counts
257 Series.values
258 Series.var
259 Series.visualize
260 Series.where
261
262 Index
263 ~~~~~~
264
265 .. autosummary::
266 :toctree: generated/
267
268 Index
269 Index.add
270 Index.align
271 Index.all
272 Index.any
273 Index.apply
274 Index.astype
275 Index.autocorr
276 Index.between
277 Index.bfill
278 Index.clear_divisions
279 Index.clip
280 Index.compute
281 Index.copy
282 Index.corr
283 Index.count
284 Index.cov
285 Index.cummax
286 Index.cummin
287 Index.cumprod
288 Index.cumsum
289 Index.describe
290 Index.diff
291 Index.div
292 Index.drop_duplicates
293 Index.dropna
294 Index.dtype
295 Index.eq
296 Index.explode
297 Index.ffill
298 Index.fillna
299 Index.first
300 Index.floordiv
301 Index.ge
302 Index.get_partition
303 Index.groupby
304 Index.gt
305 Index.head
306 Index.idxmax
307 Index.idxmin
308 Index.is_monotonic_decreasing
309 Index.is_monotonic_increasing
310 Index.isin
311 Index.isna
312 Index.isnull
313 Index.known_divisions
314 Index.last
315 Index.le
316 Index.loc
317 Index.lt
318 Index.map
319 Index.map_overlap
320 Index.map_partitions
321 Index.mask
322 Index.max
323 Index.mean
324 Index.median
325 Index.median_approximate
326 Index.memory_usage
327 Index.memory_usage_per_partition
328 Index.min
329 Index.mod
330 Index.mul
331 Index.nbytes
332 Index.ndim
333 Index.ne
334 Index.nlargest
335 Index.notnull
336 Index.nsmallest
337 Index.nunique
338 Index.nunique_approx
339 Index.persist
340 Index.pipe
341 Index.pow
342 Index.prod
343 Index.quantile
344 Index.radd
345 Index.random_split
346 Index.rdiv
347 Index.reduction
348 Index.rename
349 Index.repartition
350 Index.replace
351 Index.resample
352 Index.reset_index
353 Index.rolling
354 Index.round
355 Index.sample
356 Index.sem
357 Index.shape
358 Index.shift
359 Index.size
360 Index.std
361 Index.sub
362 Index.sum
363 Index.to_backend
364 Index.to_bag
365 Index.to_csv
366 Index.to_dask_array
367 Index.to_delayed
368 Index.to_frame
369 Index.to_hdf
370 Index.to_series
371 Index.to_string
372 Index.to_timestamp
373 Index.truediv
374 Index.unique
375 Index.value_counts
376 Index.values
377 Index.var
378 Index.visualize
379 Index.where
380 Index.to_frame
381
382 Accessors
383 ~~~~~~~~~
384 Similar to pandas, Dask provides dtype-specific methods under various accessors.
385 These are separate namespaces within :class:`Series` that only apply to specific data types.
386
387 Datetime Accessor
388 *****************
389
390 **Methods**
391
392 .. autosummary::
393 :toctree: generated/
394 :template: autosummary/accessor_method.rst
395
396 Series.dt.ceil
397 Series.dt.floor
398 Series.dt.isocalendar
399 Series.dt.normalize
400 Series.dt.round
401 Series.dt.strftime
402
403 **Attributes**
404
405 .. autosummary::
406 :toctree: generated/
407 :template: autosummary/accessor_attribute.rst
408
409 Series.dt.date
410 Series.dt.day
411 Series.dt.dayofweek
412 Series.dt.dayofyear
413 Series.dt.daysinmonth
414 Series.dt.freq
415 Series.dt.hour
416 Series.dt.microsecond
417 Series.dt.minute
418 Series.dt.month
419 Series.dt.nanosecond
420 Series.dt.quarter
421 Series.dt.second
422 Series.dt.time
423 Series.dt.timetz
424 Series.dt.tz
425 Series.dt.week
426 Series.dt.weekday
427 Series.dt.weekofyear
428 Series.dt.year
429
430 String Accessor
431 ***************
432
433 **Methods**
434
435 .. autosummary::
436 :toctree: generated/
437 :template: autosummary/accessor_method.rst
438
439 Series.str.capitalize
440 Series.str.casefold
441 Series.str.cat
442 Series.str.center
443 Series.str.contains
444 Series.str.count
445 Series.str.decode
446 Series.str.encode
447 Series.str.endswith
448 Series.str.extract
449 Series.str.extractall
450 Series.str.find
451 Series.str.findall
452 Series.str.fullmatch
453 Series.str.get
454 Series.str.index
455 Series.str.isalnum
456 Series.str.isalpha
457 Series.str.isdecimal
458 Series.str.isdigit
459 Series.str.islower
460 Series.str.isnumeric
461 Series.str.isspace
462 Series.str.istitle
463 Series.str.isupper
464 Series.str.join
465 Series.str.len
466 Series.str.ljust
467 Series.str.lower
468 Series.str.lstrip
469 Series.str.match
470 Series.str.normalize
471 Series.str.pad
472 Series.str.partition
473 Series.str.repeat
474 Series.str.replace
475 Series.str.rfind
476 Series.str.rindex
477 Series.str.rjust
478 Series.str.rpartition
479 Series.str.rsplit
480 Series.str.rstrip
481 Series.str.slice
482 Series.str.split
483 Series.str.startswith
484 Series.str.strip
485 Series.str.swapcase
486 Series.str.title
487 Series.str.translate
488 Series.str.upper
489 Series.str.wrap
490 Series.str.zfill
491
492 Categorical Accessor
493 ********************
494
495 **Methods**
496
497 .. autosummary::
498 :toctree: generated/
499 :template: autosummary/accessor_method.rst
500
501 Series.cat.add_categories
502 Series.cat.as_known
503 Series.cat.as_ordered
504 Series.cat.as_unknown
505 Series.cat.as_unordered
506 Series.cat.remove_categories
507 Series.cat.remove_unused_categories
508 Series.cat.rename_categories
509 Series.cat.reorder_categories
510 Series.cat.set_categories
511
512 **Attributes**
513
514 .. autosummary::
515 :toctree: generated/
516 :template: autosummary/accessor_attribute.rst
517
518 Series.cat.categories
519 Series.cat.codes
520 Series.cat.known
521 Series.cat.ordered
522
523 Groupby Operations
524 ~~~~~~~~~~~~~~~~~~
525
526 .. currentmodule:: dask.dataframe.groupby
527
528 DataFrame Groupby
529 *****************
530
531 .. autosummary::
532 :toctree: generated/
533
534 DataFrameGroupBy.aggregate
535 DataFrameGroupBy.apply
536 DataFrameGroupBy.bfill
537 DataFrameGroupBy.count
538 DataFrameGroupBy.cumcount
539 DataFrameGroupBy.cumprod
540 DataFrameGroupBy.cumsum
541 DataFrameGroupBy.fillna
542 DataFrameGroupBy.ffill
543 DataFrameGroupBy.get_group
544 DataFrameGroupBy.max
545 DataFrameGroupBy.mean
546 DataFrameGroupBy.min
547 DataFrameGroupBy.size
548 DataFrameGroupBy.std
549 DataFrameGroupBy.sum
550 DataFrameGroupBy.var
551 DataFrameGroupBy.cov
552 DataFrameGroupBy.corr
553 DataFrameGroupBy.first
554 DataFrameGroupBy.last
555 DataFrameGroupBy.idxmin
556 DataFrameGroupBy.idxmax
557 DataFrameGroupBy.rolling
558 DataFrameGroupBy.transform
559
560
561 Series Groupby
562 **************
563
564 .. autosummary::
565 :toctree: generated/
566
567 SeriesGroupBy.aggregate
568 SeriesGroupBy.apply
569 SeriesGroupBy.bfill
570 SeriesGroupBy.count
571 SeriesGroupBy.cumcount
572 SeriesGroupBy.cumprod
573 SeriesGroupBy.cumsum
574 SeriesGroupBy.fillna
575 SeriesGroupBy.ffill
576 SeriesGroupBy.get_group
577 SeriesGroupBy.max
578 SeriesGroupBy.mean
579 SeriesGroupBy.min
580 SeriesGroupBy.nunique
581 SeriesGroupBy.size
582 SeriesGroupBy.std
583 SeriesGroupBy.sum
584 SeriesGroupBy.var
585 SeriesGroupBy.first
586 SeriesGroupBy.last
587 SeriesGroupBy.idxmin
588 SeriesGroupBy.idxmax
589 SeriesGroupBy.rolling
590 SeriesGroupBy.transform
591
592 Custom Aggregation
593 ******************
594
595 .. autosummary::
596 :toctree: generated/
597
598 Aggregation
599
600 Rolling Operations
601 ~~~~~~~~~~~~~~~~~~
602
603 .. currentmodule:: dask.dataframe
604
605 .. autosummary::
606 :toctree: generated/
607
608 map_overlap
609 Series.rolling
610 DataFrame.rolling
611
612 .. currentmodule:: dask.dataframe.rolling
613
614 .. autosummary::
615 :toctree: generated/
616
617 Rolling.apply
618 Rolling.count
619 Rolling.kurt
620 Rolling.max
621 Rolling.mean
622 Rolling.median
623 Rolling.min
624 Rolling.quantile
625 Rolling.skew
626 Rolling.std
627 Rolling.sum
628 Rolling.var
629
630
631 Create DataFrames
632 ~~~~~~~~~~~~~~~~~
633
634 .. currentmodule:: dask.dataframe
635
636 .. autosummary::
637 :toctree: generated/
638
639 read_csv
640 read_table
641 read_fwf
642 read_parquet
643 read_hdf
644 read_json
645 read_orc
646 read_sql_table
647 read_sql_query
648 read_sql
649 from_array
650 from_dask_array
651 from_delayed
652 from_map
653 from_pandas
654 DataFrame.from_dict
655
656 .. currentmodule:: dask.bag
657
658 .. autosummary::
659 :toctree: generated/
660
661 Bag.to_dataframe
662
663 Store DataFrames
664 ~~~~~~~~~~~~~~~~
665
666 .. currentmodule:: dask.dataframe
667
668 .. autosummary::
669 :toctree: generated/
670
671 to_csv
672 to_parquet
673 to_hdf
674 to_records
675 to_sql
676 to_json
677
678 Convert DataFrames
679 ~~~~~~~~~~~~~~~~~~
680
681 .. autosummary::
682 :toctree: generated/
683
684 DataFrame.to_bag
685 DataFrame.to_dask_array
686 DataFrame.to_delayed
687
688 Reshape DataFrames
689 ~~~~~~~~~~~~~~~~~~
690
691 .. currentmodule:: dask.dataframe.reshape
692
693 .. autosummary::
694 :toctree: generated/
695
696 get_dummies
697 pivot_table
698 melt
699
700 Concatenate DataFrames
701 ~~~~~~~~~~~~~~~~~~~~~~
702
703 .. currentmodule:: dask.dataframe
704
705 .. autosummary::
706 :toctree: generated/
707
708 DataFrame.merge
709 concat
710 merge
711 merge_asof
712
713
714 Resampling
715 ~~~~~~~~~~
716
717 .. currentmodule:: dask.dataframe.tseries.resample
718
719 .. autosummary::
720 :toctree: generated/
721
722 Resampler
723 Resampler.agg
724 Resampler.count
725 Resampler.first
726 Resampler.last
727 Resampler.max
728 Resampler.mean
729 Resampler.median
730 Resampler.min
731 Resampler.nunique
732 Resampler.ohlc
733 Resampler.prod
734 Resampler.quantile
735 Resampler.sem
736 Resampler.size
737 Resampler.std
738 Resampler.sum
739 Resampler.var
740
741
742 Dask Metadata
743 ~~~~~~~~~~~~~
744
745 .. currentmodule:: dask.dataframe.utils
746
747 .. autosummary::
748 :toctree: generated/
749
750 make_meta
751
752 Other functions
753 ~~~~~~~~~~~~~~~
754
755 .. currentmodule:: dask.dataframe
756
757 .. autosummary::
758 :toctree: generated/
759
760 compute
761 map_partitions
762
763 to_datetime
764 to_numeric
765 to_timedelta