title
stringlengths 5
65
| summary
stringlengths 5
98.2k
| context
stringlengths 9
121k
| path
stringlengths 10
84
⌀ |
---|---|---|---|
pandas.tseries.offsets.FY5253.__call__
|
`pandas.tseries.offsets.FY5253.__call__`
Call self as a function.
|
FY5253.__call__(*args, **kwargs)#
Call self as a function.
|
reference/api/pandas.tseries.offsets.FY5253.__call__.html
|
How to manipulate textual data?
|
How to manipulate textual data?
This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:
PassengerId: Id of every passenger.
Survived: Indication whether passenger survived. 0 for yes and 1 for no.
Pclass: One out of the 3 ticket classes: Class 1, Class 2 and Class 3.
Name: Name of passenger.
Sex: Gender of passenger.
Age: Age of passenger in years.
SibSp: Number of siblings or spouses aboard.
Parch: Number of parents or children aboard.
Ticket: Ticket number of passenger.
Fare: Indicating the fare.
Cabin: Cabin number of passenger.
Embarked: Port of embarkation.
This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:
PassengerId: Id of every passenger.
Survived: Indication whether passenger survived. 0 for yes and 1 for no.
Pclass: One out of the 3 ticket classes: Class 1, Class 2 and Class 3.
|
Data used for this tutorial:
Titanic data
This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:
PassengerId: Id of every passenger.
Survived: Indication whether passenger survived. 0 for yes and 1 for no.
Pclass: One out of the 3 ticket classes: Class 1, Class 2 and Class 3.
Name: Name of passenger.
Sex: Gender of passenger.
Age: Age of passenger in years.
SibSp: Number of siblings or spouses aboard.
Parch: Number of parents or children aboard.
Ticket: Ticket number of passenger.
Fare: Indicating the fare.
Cabin: Cabin number of passenger.
Embarked: Port of embarkation.
To raw data
In [2]: titanic = pd.read_csv("data/titanic.csv")
In [3]: titanic.head()
Out[3]:
PassengerId Survived Pclass ... Fare Cabin Embarked
0 1 0 3 ... 7.2500 NaN S
1 2 1 1 ... 71.2833 C85 C
2 3 1 3 ... 7.9250 NaN S
3 4 1 1 ... 53.1000 C123 S
4 5 0 3 ... 8.0500 NaN S
[5 rows x 12 columns]
How to manipulate textual data?#
Make all name characters lowercase.
In [4]: titanic["Name"].str.lower()
Out[4]:
0 braund, mr. owen harris
1 cumings, mrs. john bradley (florence briggs th...
2 heikkinen, miss. laina
3 futrelle, mrs. jacques heath (lily may peel)
4 allen, mr. william henry
...
886 montvila, rev. juozas
887 graham, miss. margaret edith
888 johnston, miss. catherine helen "carrie"
889 behr, mr. karl howell
890 dooley, mr. patrick
Name: Name, Length: 891, dtype: object
To make each of the strings in the Name column lowercase, select the Name column
(see the tutorial on selection of data), add the str accessor and
apply the lower method. As such, each of the strings is converted element-wise.
Similar to datetime objects in the time series tutorial
having a dt accessor, a number of
specialized string methods are available when using the str
accessor. These methods have in general matching names with the
equivalent built-in string methods for single elements, but are applied
element-wise (remember element-wise calculations?)
on each of the values of the columns.
Create a new column Surname that contains the surname of the passengers by extracting the part before the comma.
In [5]: titanic["Name"].str.split(",")
Out[5]:
0 [Braund, Mr. Owen Harris]
1 [Cumings, Mrs. John Bradley (Florence Briggs ...
2 [Heikkinen, Miss. Laina]
3 [Futrelle, Mrs. Jacques Heath (Lily May Peel)]
4 [Allen, Mr. William Henry]
...
886 [Montvila, Rev. Juozas]
887 [Graham, Miss. Margaret Edith]
888 [Johnston, Miss. Catherine Helen "Carrie"]
889 [Behr, Mr. Karl Howell]
890 [Dooley, Mr. Patrick]
Name: Name, Length: 891, dtype: object
Using the Series.str.split() method, each of the values is returned as a list of
2 elements. The first element is the part before the comma and the
second element is the part after the comma.
In [6]: titanic["Surname"] = titanic["Name"].str.split(",").str.get(0)
In [7]: titanic["Surname"]
Out[7]:
0 Braund
1 Cumings
2 Heikkinen
3 Futrelle
4 Allen
...
886 Montvila
887 Graham
888 Johnston
889 Behr
890 Dooley
Name: Surname, Length: 891, dtype: object
As we are only interested in the first part representing the surname
(element 0), we can again use the str accessor and apply Series.str.get() to
extract the relevant part. Indeed, these string functions can be
concatenated to combine multiple functions at once!
To user guideMore information on extracting parts of strings is available in the user guide section on splitting and replacing strings.
Extract the passenger data about the countesses on board of the Titanic.
In [8]: titanic["Name"].str.contains("Countess")
Out[8]:
0 False
1 False
2 False
3 False
4 False
...
886 False
887 False
888 False
889 False
890 False
Name: Name, Length: 891, dtype: bool
In [9]: titanic[titanic["Name"].str.contains("Countess")]
Out[9]:
PassengerId Survived Pclass ... Cabin Embarked Surname
759 760 1 1 ... B77 S Rothes
[1 rows x 13 columns]
(Interested in her story? See Wikipedia!)
The string method Series.str.contains() checks for each of the values in the
column Name if the string contains the word Countess and returns
for each of the values True (Countess is part of the name) or
False (Countess is not part of the name). This output can be used
to subselect the data using conditional (boolean) indexing introduced in
the subsetting of data tutorial. As there was
only one countess on the Titanic, we get one row as a result.
Note
More powerful extractions on strings are supported, as the
Series.str.contains() and Series.str.extract() methods accept regular
expressions, but out of
scope of this tutorial.
To user guideMore information on extracting parts of strings is available in the user guide section on string matching and extracting.
Which passenger of the Titanic has the longest name?
In [10]: titanic["Name"].str.len()
Out[10]:
0 23
1 51
2 22
3 44
4 24
..
886 21
887 28
888 40
889 21
890 19
Name: Name, Length: 891, dtype: int64
To get the longest name we first have to get the lengths of each of the
names in the Name column. By using pandas string methods, the
Series.str.len() function is applied to each of the names individually
(element-wise).
In [11]: titanic["Name"].str.len().idxmax()
Out[11]: 307
Next, we need to get the corresponding location, preferably the index
label, in the table for which the name length is the largest. The
idxmax() method does exactly that. It is not a string method and is
applied to integers, so no str is used.
In [12]: titanic.loc[titanic["Name"].str.len().idxmax(), "Name"]
Out[12]: 'Penasco y Castellana, Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo)'
Based on the index name of the row (307) and the column (Name),
we can do a selection using the loc operator, introduced in the
tutorial on subsetting.
In the “Sex” column, replace values of “male” by “M” and values of “female” by “F”.
In [13]: titanic["Sex_short"] = titanic["Sex"].replace({"male": "M", "female": "F"})
In [14]: titanic["Sex_short"]
Out[14]:
0 M
1 F
2 F
3 F
4 M
..
886 M
887 F
888 F
889 M
890 M
Name: Sex_short, Length: 891, dtype: object
Whereas replace() is not a string method, it provides a convenient way
to use mappings or vocabularies to translate certain values. It requires
a dictionary to define the mapping {from : to}.
Warning
There is also a replace() method available to replace a
specific set of characters. However, when having a mapping of multiple
values, this would become:
titanic["Sex_short"] = titanic["Sex"].str.replace("female", "F")
titanic["Sex_short"] = titanic["Sex_short"].str.replace("male", "M")
This would become cumbersome and easily lead to mistakes. Just think (or
try out yourself) what would happen if those two statements are applied
in the opposite order…
REMEMBER
String methods are available using the str accessor.
String methods work element-wise and can be used for conditional
indexing.
The replace method is a convenient method to convert values
according to a given dictionary.
To user guideA full overview is provided in the user guide pages on working with text data.
|
getting_started/intro_tutorials/10_text_data.html
|
Index
|
Index
|
_
| A
| B
| C
| D
| E
| F
| G
| H
| I
| J
| K
| L
| M
| N
| O
| P
| Q
| R
| S
| T
| U
| V
| W
| X
| Y
| Z
_
__array__() (pandas.Categorical method)
(pandas.Series method)
__call__() (pandas.option_context method)
(pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
__dataframe__() (pandas.DataFrame method)
__iter__() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
_concat_same_type() (pandas.api.extensions.ExtensionArray class method)
_formatter() (pandas.api.extensions.ExtensionArray method)
_from_factorized() (pandas.api.extensions.ExtensionArray class method)
_from_sequence() (pandas.api.extensions.ExtensionArray class method)
_from_sequence_of_strings() (pandas.api.extensions.ExtensionArray class method)
_reduce() (pandas.api.extensions.ExtensionArray method)
_values_for_argsort() (pandas.api.extensions.ExtensionArray method)
_values_for_factorize() (pandas.api.extensions.ExtensionArray method)
A
abs() (pandas.DataFrame method)
(pandas.Series method)
AbstractMethodError
AccessorRegistrationWarning
add() (pandas.DataFrame method)
(pandas.Series method)
add_categories() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
add_prefix() (pandas.DataFrame method)
(pandas.Series method)
add_suffix() (pandas.DataFrame method)
(pandas.Series method)
agg() (pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
aggregate() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.SeriesGroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
align() (pandas.DataFrame method)
(pandas.Series method)
all() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
allows_duplicate_labels (pandas.Flags property)
andrews_curves() (in module pandas.plotting)
any() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
append() (pandas.DataFrame method)
(pandas.HDFStore method)
(pandas.Index method)
(pandas.Series method)
apply() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
(pandas.Series method)
(pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
apply_index() (pandas.io.formats.style.Styler method)
(pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
applymap() (pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
applymap_index() (pandas.io.formats.style.Styler method)
area() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
argmax() (pandas.Index method)
(pandas.Series method)
argmin() (pandas.Index method)
(pandas.Series method)
argsort() (pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
array (pandas.Index attribute)
(pandas.Series property)
array() (in module pandas)
ArrowDtype (class in pandas)
ArrowExtensionArray (class in pandas.arrays)
ArrowStringArray (class in pandas.arrays)
as_ordered() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
as_unordered() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
asfreq() (pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Period method)
(pandas.PeriodIndex method)
(pandas.Series method)
asi8 (pandas.Index property)
asm8 (pandas.Timedelta attribute)
(pandas.Timestamp attribute)
asof() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
asof_locs() (pandas.Index method)
assert_extension_array_equal() (in module pandas.testing)
assert_frame_equal() (in module pandas.testing)
assert_index_equal() (in module pandas.testing)
assert_series_equal() (in module pandas.testing)
assign() (pandas.DataFrame method)
astimezone() (pandas.Timestamp method)
astype() (pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
at (pandas.DataFrame property)
(pandas.Series property)
at_time() (pandas.DataFrame method)
(pandas.Series method)
AttributeConflictWarning
attrs (pandas.DataFrame property)
(pandas.Series property)
autocorr() (pandas.Series method)
autocorrelation_plot() (in module pandas.plotting)
axes (pandas.DataFrame property)
(pandas.Series property)
B
backfill() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
background_gradient() (pandas.io.formats.style.Styler method)
bar() (pandas.DataFrame.plot method)
(pandas.io.formats.style.Styler method)
(pandas.Series.plot method)
barh() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
base (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
BaseIndexer (class in pandas.api.indexers)
bdate_range() (in module pandas)
BDay (in module pandas.tseries.offsets)
between() (pandas.Series method)
between_time() (pandas.DataFrame method)
(pandas.Series method)
bfill() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
BMonthBegin (in module pandas.tseries.offsets)
BMonthEnd (in module pandas.tseries.offsets)
book (pandas.ExcelWriter property)
bool() (pandas.DataFrame method)
(pandas.Series method)
BooleanArray (class in pandas.arrays)
BooleanDtype (class in pandas)
bootstrap_plot() (in module pandas.plotting)
box() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
boxplot() (in module pandas.plotting)
(pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
BQuarterBegin (class in pandas.tseries.offsets)
BQuarterEnd (class in pandas.tseries.offsets)
build_table_schema() (in module pandas.io.json)
BusinessDay (class in pandas.tseries.offsets)
BusinessHour (class in pandas.tseries.offsets)
BusinessMonthBegin (class in pandas.tseries.offsets)
BusinessMonthEnd (class in pandas.tseries.offsets)
BYearBegin (class in pandas.tseries.offsets)
BYearEnd (class in pandas.tseries.offsets)
C
calendar (pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
capitalize() (pandas.Series.str method)
casefold() (pandas.Series.str method)
cat() (pandas.Series method)
(pandas.Series.str method)
Categorical (class in pandas)
CategoricalConversionWarning
CategoricalDtype (class in pandas)
CategoricalIndex (class in pandas)
categories (pandas.Categorical property)
(pandas.CategoricalDtype property)
(pandas.CategoricalIndex property)
(pandas.Series.cat attribute)
cbday_roll (pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
CBMonthBegin (in module pandas.tseries.offsets)
CBMonthEnd (in module pandas.tseries.offsets)
CDay (in module pandas.tseries.offsets)
ceil() (pandas.DatetimeIndex method)
(pandas.Series.dt method)
(pandas.Timedelta method)
(pandas.TimedeltaIndex method)
(pandas.Timestamp method)
center() (pandas.Series.str method)
check_array_indexer() (in module pandas.api.indexers)
check_extension() (pandas.ExcelWriter class method)
clear() (pandas.io.formats.style.Styler method)
clip() (pandas.DataFrame method)
(pandas.Series method)
close() (pandas.ExcelWriter method)
closed (pandas.arrays.IntervalArray property)
(pandas.Interval attribute)
(pandas.IntervalIndex attribute)
closed_left (pandas.Interval attribute)
closed_right (pandas.Interval attribute)
ClosedFileError
codes (pandas.Categorical property)
(pandas.CategoricalIndex property)
(pandas.MultiIndex property)
(pandas.Series.cat attribute)
columns (pandas.DataFrame attribute)
combine() (pandas.DataFrame method)
(pandas.Series method)
(pandas.Timestamp class method)
combine_first() (pandas.DataFrame method)
(pandas.Series method)
compare() (pandas.DataFrame method)
(pandas.Series method)
components (pandas.Series.dt attribute)
(pandas.Timedelta attribute)
(pandas.TimedeltaIndex property)
concat() (in module pandas)
(pandas.io.formats.style.Styler method)
construct_array_type() (pandas.api.extensions.ExtensionDtype class method)
construct_from_string() (pandas.api.extensions.ExtensionDtype class method)
contains() (pandas.arrays.IntervalArray method)
(pandas.IntervalIndex method)
(pandas.Series.str method)
convert_dtypes() (pandas.DataFrame method)
(pandas.Series method)
copy() (pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
(pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
corr (pandas.core.groupby.DataFrameGroupBy property)
corr() (pandas.core.window.ewm.ExponentialMovingWindow method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
corrwith (pandas.core.groupby.DataFrameGroupBy property)
corrwith() (pandas.DataFrame method)
count() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
(pandas.Series.str method)
cov (pandas.core.groupby.DataFrameGroupBy property)
cov() (pandas.core.window.ewm.ExponentialMovingWindow method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
crosstab() (in module pandas)
CSSWarning
ctime() (pandas.Timestamp method)
cumcount() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
cummax() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
cummin() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
cumprod() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
cumsum() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
cur_sheet (pandas.ExcelWriter property)
CustomBusinessDay (class in pandas.tseries.offsets)
CustomBusinessHour (class in pandas.tseries.offsets)
CustomBusinessMonthBegin (class in pandas.tseries.offsets)
CustomBusinessMonthEnd (class in pandas.tseries.offsets)
cut() (in module pandas)
D
data_label (pandas.io.stata.StataReader property)
DatabaseError
DataError
DataFrame (class in pandas)
date (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
date() (pandas.Timestamp method)
date_format (pandas.ExcelWriter property)
date_range() (in module pandas)
DateOffset (class in pandas.tseries.offsets)
datetime_format (pandas.ExcelWriter property)
DatetimeArray (class in pandas.arrays)
DatetimeIndex (class in pandas)
DatetimeTZDtype (class in pandas)
Day (class in pandas.tseries.offsets)
day (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
day_name() (pandas.DatetimeIndex method)
(pandas.Series.dt method)
(pandas.Timestamp method)
day_of_month (pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
day_of_week (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
day_of_year (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
dayofweek (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
dayofyear (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
days (pandas.Series.dt attribute)
(pandas.Timedelta attribute)
(pandas.TimedeltaIndex property)
days_in_month (pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
daysinmonth (pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
decode() (pandas.Series.str method)
delete() (pandas.Index method)
delta (pandas.Timedelta attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.Tick attribute)
density (pandas.DataFrame.sparse attribute)
(pandas.Series.sparse attribute)
density() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
deregister_matplotlib_converters() (in module pandas.plotting)
describe() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
describe_option (in module pandas)
diff() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
difference() (pandas.Index method)
div() (pandas.DataFrame method)
(pandas.Series method)
divide() (pandas.DataFrame method)
(pandas.Series method)
divmod() (pandas.Series method)
dot() (pandas.DataFrame method)
(pandas.Series method)
drop() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
drop_duplicates() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
droplevel() (pandas.DataFrame method)
(pandas.Index method)
(pandas.MultiIndex method)
(pandas.Series method)
dropna() (pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
dst() (pandas.Timestamp method)
dt() (pandas.Series method)
dtype (pandas.api.extensions.ExtensionArray property)
(pandas.Categorical property)
(pandas.Index attribute)
(pandas.Series property)
dtypes (pandas.DataFrame property)
(pandas.MultiIndex attribute)
(pandas.Series property)
DtypeWarning
duplicated() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
DuplicateLabelError
E
Easter (class in pandas.tseries.offsets)
empty (pandas.DataFrame property)
(pandas.Index property)
(pandas.Series property)
empty() (pandas.api.extensions.ExtensionDtype method)
EmptyDataError
encode() (pandas.Series.str method)
end (pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
end_time (pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
endswith() (pandas.Series.str method)
engine (pandas.ExcelWriter property)
env (pandas.io.formats.style.Styler attribute)
eq() (pandas.DataFrame method)
(pandas.Series method)
equals() (pandas.api.extensions.ExtensionArray method)
(pandas.CategoricalIndex method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
eval() (in module pandas)
(pandas.DataFrame method)
ewm() (pandas.DataFrame method)
(pandas.Series method)
ExcelWriter (class in pandas)
expanding() (pandas.DataFrame method)
(pandas.Series method)
explode() (pandas.DataFrame method)
(pandas.Series method)
export() (pandas.io.formats.style.Styler method)
ExtensionArray (class in pandas.api.extensions)
ExtensionDtype (class in pandas.api.extensions)
extract() (pandas.Series.str method)
extractall() (pandas.Series.str method)
F
factorize() (in module pandas)
(pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
ffill() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
fill_value (pandas.Series.sparse attribute)
fillna (pandas.core.groupby.DataFrameGroupBy property)
fillna() (pandas.api.extensions.ExtensionArray method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
filter() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
find() (pandas.Series.str method)
findall() (pandas.Series.str method)
first() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
first_valid_index() (pandas.DataFrame method)
(pandas.Series method)
FixedForwardWindowIndexer (class in pandas.api.indexers)
Flags (class in pandas)
flags (pandas.DataFrame property)
(pandas.Series property)
Float64Index (class in pandas)
floor() (pandas.DatetimeIndex method)
(pandas.Series.dt method)
(pandas.Timedelta method)
(pandas.TimedeltaIndex method)
(pandas.Timestamp method)
floordiv() (pandas.DataFrame method)
(pandas.Series method)
fold (pandas.Timestamp attribute)
format() (pandas.Index method)
(pandas.io.formats.style.Styler method)
format_index() (pandas.io.formats.style.Styler method)
freq (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodDtype property)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timedelta attribute)
(pandas.Timestamp attribute)
freqstr (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Timestamp property)
(pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
from_arrays() (pandas.arrays.IntervalArray class method)
(pandas.IntervalIndex class method)
(pandas.MultiIndex class method)
from_breaks() (pandas.arrays.IntervalArray class method)
(pandas.IntervalIndex class method)
from_codes() (pandas.Categorical class method)
from_coo() (pandas.Series.sparse class method)
from_custom_template() (pandas.io.formats.style.Styler class method)
from_dataframe() (in module pandas.api.interchange)
from_dict() (pandas.DataFrame class method)
from_dummies() (in module pandas)
from_frame() (pandas.MultiIndex class method)
from_product() (pandas.MultiIndex class method)
from_range() (pandas.RangeIndex class method)
from_records() (pandas.DataFrame class method)
from_spmatrix() (pandas.DataFrame.sparse class method)
from_tuples() (pandas.arrays.IntervalArray class method)
(pandas.IntervalIndex class method)
(pandas.MultiIndex class method)
fromisocalendar() (pandas.Timestamp method)
fromisoformat() (pandas.Timestamp method)
fromordinal() (pandas.Timestamp class method)
fromtimestamp() (pandas.Timestamp class method)
fullmatch() (pandas.Series.str method)
FY5253 (class in pandas.tseries.offsets)
FY5253Quarter (class in pandas.tseries.offsets)
G
ge() (pandas.DataFrame method)
(pandas.Series method)
get() (pandas.DataFrame method)
(pandas.HDFStore method)
(pandas.Series method)
(pandas.Series.str method)
get_dummies() (in module pandas)
(pandas.Series.str method)
get_group() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
get_indexer() (pandas.Index method)
(pandas.IntervalIndex method)
(pandas.MultiIndex method)
get_indexer_for() (pandas.Index method)
get_indexer_non_unique() (pandas.Index method)
get_level_values() (pandas.Index method)
(pandas.MultiIndex method)
get_loc() (pandas.Index method)
(pandas.IntervalIndex method)
(pandas.MultiIndex method)
get_loc_level() (pandas.MultiIndex method)
get_locs() (pandas.MultiIndex method)
get_option (in module pandas)
get_rule_code_suffix() (pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
get_slice_bound() (pandas.Index method)
get_value() (pandas.Index method)
get_weeks() (pandas.tseries.offsets.FY5253Quarter method)
get_window_bounds() (pandas.api.indexers.BaseIndexer method)
(pandas.api.indexers.FixedForwardWindowIndexer method)
(pandas.api.indexers.VariableOffsetWindowIndexer method)
get_year_end() (pandas.tseries.offsets.FY5253 method)
groupby() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
Grouper (class in pandas)
groups (pandas.core.groupby.GroupBy property)
(pandas.core.resample.Resampler property)
groups() (pandas.HDFStore method)
gt() (pandas.DataFrame method)
(pandas.Series method)
H
handles (pandas.ExcelWriter property)
has_duplicates (pandas.Index property)
hash_array() (in module pandas.util)
hash_pandas_object() (in module pandas.util)
hasnans (pandas.Index attribute)
(pandas.Series property)
head() (pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
hexbin() (pandas.DataFrame.plot method)
hide() (pandas.io.formats.style.Styler method)
hide_columns() (pandas.io.formats.style.Styler method)
hide_index() (pandas.io.formats.style.Styler method)
highlight_between() (pandas.io.formats.style.Styler method)
highlight_max() (pandas.io.formats.style.Styler method)
highlight_min() (pandas.io.formats.style.Styler method)
highlight_null() (pandas.io.formats.style.Styler method)
highlight_quantile() (pandas.io.formats.style.Styler method)
hist (pandas.core.groupby.DataFrameGroupBy property)
(pandas.core.groupby.SeriesGroupBy property)
hist() (pandas.DataFrame method)
(pandas.DataFrame.plot method)
(pandas.Series method)
(pandas.Series.plot method)
holds_integer() (pandas.Index method)
holidays (pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
Hour (class in pandas.tseries.offsets)
hour (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
I
iat (pandas.DataFrame property)
(pandas.Series property)
identical() (pandas.Index method)
idxmax() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
idxmin() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
if_sheet_exists (pandas.ExcelWriter property)
iloc (pandas.DataFrame property)
(pandas.Series property)
IncompatibilityWarning
Index (class in pandas)
index (pandas.DataFrame attribute)
(pandas.Series attribute)
index() (pandas.Series.str method)
indexer_at_time() (pandas.DatetimeIndex method)
indexer_between_time() (pandas.DatetimeIndex method)
IndexingError
IndexSlice (in module pandas)
indices (pandas.core.groupby.GroupBy property)
(pandas.core.resample.Resampler property)
infer_dtype() (in module pandas.api.types)
infer_freq() (in module pandas)
infer_objects() (pandas.DataFrame method)
(pandas.Series method)
inferred_freq (pandas.DatetimeIndex attribute)
(pandas.TimedeltaIndex attribute)
inferred_type (pandas.Index attribute)
info() (pandas.DataFrame method)
(pandas.HDFStore method)
(pandas.Series method)
insert() (pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
Int16Dtype (class in pandas)
Int32Dtype (class in pandas)
Int64Dtype (class in pandas)
Int64Index (class in pandas)
Int8Dtype (class in pandas)
IntCastingNaNError
IntegerArray (class in pandas.arrays)
interpolate() (pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
intersection() (pandas.Index method)
Interval (class in pandas)
interval_range() (in module pandas)
IntervalArray (class in pandas.arrays)
IntervalDtype (class in pandas)
IntervalIndex (class in pandas)
InvalidColumnName
InvalidIndexError
is_() (pandas.Index method)
is_all_dates (pandas.Index attribute)
is_anchored() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_bool() (in module pandas.api.types)
is_bool_dtype() (in module pandas.api.types)
is_boolean() (pandas.Index method)
is_categorical() (in module pandas.api.types)
(pandas.Index method)
is_categorical_dtype() (in module pandas.api.types)
is_complex() (in module pandas.api.types)
is_complex_dtype() (in module pandas.api.types)
is_datetime64_any_dtype() (in module pandas.api.types)
is_datetime64_dtype() (in module pandas.api.types)
is_datetime64_ns_dtype() (in module pandas.api.types)
is_datetime64tz_dtype() (in module pandas.api.types)
is_dict_like() (in module pandas.api.types)
is_dtype() (pandas.api.extensions.ExtensionDtype class method)
is_empty (pandas.arrays.IntervalArray attribute)
(pandas.Interval attribute)
(pandas.IntervalIndex property)
is_extension_array_dtype() (in module pandas.api.types)
is_extension_type() (in module pandas.api.types)
is_file_like() (in module pandas.api.types)
is_float() (in module pandas.api.types)
is_float_dtype() (in module pandas.api.types)
is_floating() (pandas.Index method)
is_hashable() (in module pandas.api.types)
is_int64_dtype() (in module pandas.api.types)
is_integer() (in module pandas.api.types)
(pandas.Index method)
is_integer_dtype() (in module pandas.api.types)
is_interval() (in module pandas.api.types)
(pandas.Index method)
is_interval_dtype() (in module pandas.api.types)
is_iterator() (in module pandas.api.types)
is_leap_year (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_list_like() (in module pandas.api.types)
is_mixed() (pandas.Index method)
is_monotonic (pandas.Index property)
(pandas.Series property)
is_monotonic_decreasing (pandas.core.groupby.SeriesGroupBy property)
(pandas.Index property)
(pandas.Series property)
is_monotonic_increasing (pandas.core.groupby.SeriesGroupBy property)
(pandas.Index property)
(pandas.Series property)
is_month_end (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_month_end() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_month_start (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_month_start() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_named_tuple() (in module pandas.api.types)
is_non_overlapping_monotonic (pandas.arrays.IntervalArray property)
(pandas.IntervalIndex attribute)
is_number() (in module pandas.api.types)
is_numeric() (pandas.Index method)
is_numeric_dtype() (in module pandas.api.types)
is_object() (pandas.Index method)
is_object_dtype() (in module pandas.api.types)
is_on_offset() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_overlapping (pandas.IntervalIndex property)
is_period_dtype() (in module pandas.api.types)
is_populated (pandas.Timedelta attribute)
is_quarter_end (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_quarter_end() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_quarter_start (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_quarter_start() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_re() (in module pandas.api.types)
is_re_compilable() (in module pandas.api.types)
is_scalar() (in module pandas.api.types)
is_signed_integer_dtype() (in module pandas.api.types)
is_sparse() (in module pandas.api.types)
is_string_dtype() (in module pandas.api.types)
is_timedelta64_dtype() (in module pandas.api.types)
is_timedelta64_ns_dtype() (in module pandas.api.types)
is_type_compatible() (pandas.Index method)
is_unique (pandas.Index attribute)
(pandas.Series property)
is_unsigned_integer_dtype() (in module pandas.api.types)
is_year_end (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_year_end() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
is_year_start (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
is_year_start() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
isalnum() (pandas.Series.str method)
isalpha() (pandas.Series.str method)
isAnchored() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
isdecimal() (pandas.Series.str method)
isdigit() (pandas.Series.str method)
isetitem() (pandas.DataFrame method)
isin() (pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
islower() (pandas.Series.str method)
isna() (in module pandas)
(pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
isnull() (in module pandas)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
isnumeric() (pandas.Series.str method)
isocalendar() (pandas.Series.dt method)
(pandas.Timestamp method)
isoformat() (pandas.Timedelta method)
(pandas.Timestamp method)
isoweekday() (pandas.Timestamp method)
isspace() (pandas.Series.str method)
istitle() (pandas.Series.str method)
isupper() (pandas.Series.str method)
item() (pandas.Index method)
(pandas.Series method)
items() (pandas.DataFrame method)
(pandas.Series method)
iteritems() (pandas.DataFrame method)
(pandas.Series method)
iterrows() (pandas.DataFrame method)
itertuples() (pandas.DataFrame method)
J
join() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series.str method)
json_normalize() (in module pandas)
K
kde() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
keys() (pandas.DataFrame method)
(pandas.HDFStore method)
(pandas.Series method)
kind (pandas.api.extensions.ExtensionDtype property)
kurt() (pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
kurtosis() (pandas.DataFrame method)
(pandas.Series method)
kwds (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
L
lag_plot() (in module pandas.plotting)
last() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
last_valid_index() (pandas.DataFrame method)
(pandas.Series method)
LastWeekOfMonth (class in pandas.tseries.offsets)
le() (pandas.DataFrame method)
(pandas.Series method)
left (pandas.arrays.IntervalArray property)
(pandas.Interval attribute)
(pandas.IntervalIndex attribute)
len() (pandas.Series.str method)
length (pandas.arrays.IntervalArray property)
(pandas.Interval attribute)
(pandas.IntervalIndex property)
levels (pandas.MultiIndex attribute)
levshape (pandas.MultiIndex property)
line() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
ljust() (pandas.Series.str method)
loader (pandas.io.formats.style.Styler attribute)
loc (pandas.DataFrame property)
(pandas.Series property)
lookup() (pandas.DataFrame method)
lower() (pandas.Series.str method)
lstrip() (pandas.Series.str method)
lt() (pandas.DataFrame method)
(pandas.Series method)
M
m_offset (pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
mad (pandas.core.groupby.DataFrameGroupBy property)
mad() (pandas.DataFrame method)
(pandas.Series method)
map() (pandas.CategoricalIndex method)
(pandas.Index method)
(pandas.Series method)
mask() (pandas.DataFrame method)
(pandas.Series method)
match() (pandas.Series.str method)
max (pandas.Timedelta attribute)
(pandas.Timestamp attribute)
max() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
mean() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.ewm.ExponentialMovingWindow method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.core.window.rolling.Window method)
(pandas.DataFrame method)
(pandas.DatetimeIndex method)
(pandas.Series method)
(pandas.TimedeltaIndex method)
median() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
melt() (in module pandas)
(pandas.DataFrame method)
memory_usage() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
merge() (in module pandas)
(pandas.DataFrame method)
merge_asof() (in module pandas)
merge_ordered() (in module pandas)
MergeError
Micro (class in pandas.tseries.offsets)
microsecond (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
microseconds (pandas.Series.dt attribute)
(pandas.Timedelta attribute)
(pandas.TimedeltaIndex property)
mid (pandas.arrays.IntervalArray property)
(pandas.Interval attribute)
(pandas.IntervalIndex attribute)
Milli (class in pandas.tseries.offsets)
min (pandas.Timedelta attribute)
(pandas.Timestamp attribute)
min() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
Minute (class in pandas.tseries.offsets)
minute (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
mod() (pandas.DataFrame method)
(pandas.Series method)
mode() (pandas.DataFrame method)
(pandas.Series method)
module
pandas
month (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
month_name() (pandas.DatetimeIndex method)
(pandas.Series.dt method)
(pandas.Timestamp method)
month_roll (pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
MonthBegin (class in pandas.tseries.offsets)
MonthEnd (class in pandas.tseries.offsets)
mul() (pandas.DataFrame method)
(pandas.Series method)
MultiIndex (class in pandas)
multiply() (pandas.DataFrame method)
(pandas.Series method)
N
n (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
na_value (pandas.api.extensions.ExtensionDtype property)
name (pandas.api.extensions.ExtensionDtype property)
(pandas.Index property)
(pandas.Series property)
(pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
names (pandas.api.extensions.ExtensionDtype property)
(pandas.Index property)
(pandas.MultiIndex property)
Nano (class in pandas.tseries.offsets)
nanos (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
nanosecond (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
nanoseconds (pandas.Series.dt attribute)
(pandas.Timedelta attribute)
(pandas.TimedeltaIndex property)
nbytes (pandas.api.extensions.ExtensionArray property)
(pandas.Index property)
(pandas.Series property)
ndim (pandas.api.extensions.ExtensionArray property)
(pandas.DataFrame property)
(pandas.Index property)
(pandas.Series property)
ne() (pandas.DataFrame method)
(pandas.Series method)
nearest() (pandas.core.resample.Resampler method)
next_bday (pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
ngroup() (pandas.core.groupby.GroupBy method)
nlargest() (pandas.core.groupby.SeriesGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
nlevels (pandas.Index property)
(pandas.MultiIndex property)
normalize (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
normalize() (pandas.DatetimeIndex method)
(pandas.Series.dt method)
(pandas.Series.str method)
(pandas.Timestamp method)
notna() (in module pandas)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
notnull() (in module pandas)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
now() (pandas.Period method)
(pandas.Timestamp class method)
npoints (pandas.Series.sparse attribute)
nsmallest() (pandas.core.groupby.SeriesGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
nth (pandas.core.groupby.GroupBy property)
NullFrequencyError
NumbaUtilError
NumExprClobberingError
nunique() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
O
offset (pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
ohlc() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
onOffset() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
open_left (pandas.Interval attribute)
open_right (pandas.Interval attribute)
option_context (class in pandas)
OptionError
ordered (pandas.Categorical property)
(pandas.CategoricalDtype property)
(pandas.CategoricalIndex property)
(pandas.Series.cat attribute)
ordinal (pandas.Period attribute)
OutOfBoundsDatetime
OutOfBoundsTimedelta
overlaps() (pandas.arrays.IntervalArray method)
(pandas.Interval method)
(pandas.IntervalIndex method)
P
pad() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
(pandas.Series.str method)
pandas
module
pandas_dtype() (in module pandas.api.types)
PandasArray (class in pandas.arrays)
parallel_coordinates() (in module pandas.plotting)
parse() (pandas.ExcelFile method)
ParserError
ParserWarning
partition() (pandas.Series.str method)
path (pandas.ExcelWriter property)
pct_change() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
PerformanceWarning
Period (class in pandas)
period_range() (in module pandas)
PeriodArray (class in pandas.arrays)
PeriodDtype (class in pandas)
PeriodIndex (class in pandas)
pie() (pandas.DataFrame.plot method)
(pandas.Series.plot method)
pipe() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
(pandas.Series method)
pivot() (in module pandas)
(pandas.DataFrame method)
pivot_table() (in module pandas)
(pandas.DataFrame method)
plot (pandas.core.groupby.DataFrameGroupBy property)
plot() (pandas.DataFrame method)
(pandas.Series method)
plot_params (in module pandas.plotting)
pop() (pandas.DataFrame method)
(pandas.Series method)
PossibleDataLossError
PossiblePrecisionLoss
pow() (pandas.DataFrame method)
(pandas.Series method)
prod() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
product() (pandas.DataFrame method)
(pandas.Series method)
put() (pandas.HDFStore method)
putmask() (pandas.Index method)
PyperclipException
PyperclipWindowsException
Python Enhancement Proposals
PEP 484
PEP 561
PEP 585
PEP 8#imports
Q
qcut() (in module pandas)
qtr_with_extra_week (pandas.tseries.offsets.FY5253Quarter attribute)
quantile() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
quarter (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
QuarterBegin (class in pandas.tseries.offsets)
QuarterEnd (class in pandas.tseries.offsets)
query() (pandas.DataFrame method)
qyear (pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
R
radd() (pandas.DataFrame method)
(pandas.Series method)
radviz() (in module pandas.plotting)
RangeIndex (class in pandas)
rank() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
ravel() (pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
rdiv() (pandas.DataFrame method)
(pandas.Series method)
rdivmod() (pandas.Series method)
read_clipboard() (in module pandas)
read_csv() (in module pandas)
read_excel() (in module pandas)
read_feather() (in module pandas)
read_fwf() (in module pandas)
read_gbq() (in module pandas)
read_hdf() (in module pandas)
read_html() (in module pandas)
read_json() (in module pandas)
read_orc() (in module pandas)
read_parquet() (in module pandas)
read_pickle() (in module pandas)
read_sas() (in module pandas)
read_spss() (in module pandas)
read_sql() (in module pandas)
read_sql_query() (in module pandas)
read_sql_table() (in module pandas)
read_stata() (in module pandas)
read_table() (in module pandas)
read_xml() (in module pandas)
register_dataframe_accessor() (in module pandas.api.extensions)
register_extension_dtype() (in module pandas.api.extensions)
register_index_accessor() (in module pandas.api.extensions)
register_matplotlib_converters() (in module pandas.plotting)
register_series_accessor() (in module pandas.api.extensions)
reindex() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
reindex_like() (pandas.DataFrame method)
(pandas.Series method)
relabel_index() (pandas.io.formats.style.Styler method)
remove_categories() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
remove_unused_categories() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
remove_unused_levels() (pandas.MultiIndex method)
removeprefix() (pandas.Series.str method)
removesuffix() (pandas.Series.str method)
rename() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
rename_axis() (pandas.DataFrame method)
(pandas.Series method)
rename_categories() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
render() (pandas.io.formats.style.Styler method)
reorder_categories() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
reorder_levels() (pandas.DataFrame method)
(pandas.MultiIndex method)
(pandas.Series method)
repeat() (pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
(pandas.Series.str method)
replace() (pandas.DataFrame method)
(pandas.Series method)
(pandas.Series.str method)
(pandas.Timestamp method)
resample() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
reset_index() (pandas.DataFrame method)
(pandas.Series method)
reset_option (in module pandas)
resolution (pandas.Timedelta attribute)
(pandas.Timestamp attribute)
resolution_string (pandas.Timedelta attribute)
rfind() (pandas.Series.str method)
rfloordiv() (pandas.DataFrame method)
(pandas.Series method)
right (pandas.arrays.IntervalArray property)
(pandas.Interval attribute)
(pandas.IntervalIndex attribute)
rindex() (pandas.Series.str method)
rjust() (pandas.Series.str method)
rmod() (pandas.DataFrame method)
(pandas.Series method)
rmul() (pandas.DataFrame method)
(pandas.Series method)
rollback() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
rollforward() (pandas.tseries.offsets.BQuarterBegin method)
(pandas.tseries.offsets.BQuarterEnd method)
(pandas.tseries.offsets.BusinessDay method)
(pandas.tseries.offsets.BusinessHour method)
(pandas.tseries.offsets.BusinessMonthBegin method)
(pandas.tseries.offsets.BusinessMonthEnd method)
(pandas.tseries.offsets.BYearBegin method)
(pandas.tseries.offsets.BYearEnd method)
(pandas.tseries.offsets.CustomBusinessDay method)
(pandas.tseries.offsets.CustomBusinessHour method)
(pandas.tseries.offsets.CustomBusinessMonthBegin method)
(pandas.tseries.offsets.CustomBusinessMonthEnd method)
(pandas.tseries.offsets.DateOffset method)
(pandas.tseries.offsets.Day method)
(pandas.tseries.offsets.Easter method)
(pandas.tseries.offsets.FY5253 method)
(pandas.tseries.offsets.FY5253Quarter method)
(pandas.tseries.offsets.Hour method)
(pandas.tseries.offsets.LastWeekOfMonth method)
(pandas.tseries.offsets.Micro method)
(pandas.tseries.offsets.Milli method)
(pandas.tseries.offsets.Minute method)
(pandas.tseries.offsets.MonthBegin method)
(pandas.tseries.offsets.MonthEnd method)
(pandas.tseries.offsets.Nano method)
(pandas.tseries.offsets.QuarterBegin method)
(pandas.tseries.offsets.QuarterEnd method)
(pandas.tseries.offsets.Second method)
(pandas.tseries.offsets.SemiMonthBegin method)
(pandas.tseries.offsets.SemiMonthEnd method)
(pandas.tseries.offsets.Tick method)
(pandas.tseries.offsets.Week method)
(pandas.tseries.offsets.WeekOfMonth method)
(pandas.tseries.offsets.YearBegin method)
(pandas.tseries.offsets.YearEnd method)
rolling() (pandas.DataFrame method)
(pandas.Series method)
round() (pandas.DataFrame method)
(pandas.DatetimeIndex method)
(pandas.Series method)
(pandas.Series.dt method)
(pandas.Timedelta method)
(pandas.TimedeltaIndex method)
(pandas.Timestamp method)
rpartition() (pandas.Series.str method)
rpow() (pandas.DataFrame method)
(pandas.Series method)
rsplit() (pandas.Series.str method)
rstrip() (pandas.Series.str method)
rsub() (pandas.DataFrame method)
(pandas.Series method)
rtruediv() (pandas.DataFrame method)
(pandas.Series method)
rule_code (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.BusinessMonthBegin attribute)
(pandas.tseries.offsets.BusinessMonthEnd attribute)
(pandas.tseries.offsets.BYearBegin attribute)
(pandas.tseries.offsets.BYearEnd attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
(pandas.tseries.offsets.DateOffset attribute)
(pandas.tseries.offsets.Day attribute)
(pandas.tseries.offsets.Easter attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.Hour attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Micro attribute)
(pandas.tseries.offsets.Milli attribute)
(pandas.tseries.offsets.Minute attribute)
(pandas.tseries.offsets.MonthBegin attribute)
(pandas.tseries.offsets.MonthEnd attribute)
(pandas.tseries.offsets.Nano attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
(pandas.tseries.offsets.Second attribute)
(pandas.tseries.offsets.SemiMonthBegin attribute)
(pandas.tseries.offsets.SemiMonthEnd attribute)
(pandas.tseries.offsets.Tick attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
(pandas.tseries.offsets.YearBegin attribute)
(pandas.tseries.offsets.YearEnd attribute)
S
sample() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
save() (pandas.ExcelWriter method)
scatter() (pandas.DataFrame.plot method)
scatter_matrix() (in module pandas.plotting)
searchsorted() (pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
Second (class in pandas.tseries.offsets)
second (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
seconds (pandas.Series.dt attribute)
(pandas.Timedelta attribute)
(pandas.TimedeltaIndex property)
select() (pandas.HDFStore method)
select_dtypes() (pandas.DataFrame method)
sem() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
SemiMonthBegin (class in pandas.tseries.offsets)
SemiMonthEnd (class in pandas.tseries.offsets)
Series (class in pandas)
set_axis() (pandas.DataFrame method)
(pandas.Series method)
set_caption() (pandas.io.formats.style.Styler method)
set_categories() (pandas.CategoricalIndex method)
(pandas.Series.cat method)
set_closed() (pandas.arrays.IntervalArray method)
(pandas.IntervalIndex method)
set_codes() (pandas.MultiIndex method)
set_flags() (pandas.DataFrame method)
(pandas.Series method)
set_index() (pandas.DataFrame method)
set_levels() (pandas.MultiIndex method)
set_na_rep() (pandas.io.formats.style.Styler method)
set_names() (pandas.Index method)
set_option (in module pandas)
set_precision() (pandas.io.formats.style.Styler method)
set_properties() (pandas.io.formats.style.Styler method)
set_sticky() (pandas.io.formats.style.Styler method)
set_table_attributes() (pandas.io.formats.style.Styler method)
set_table_styles() (pandas.io.formats.style.Styler method)
set_td_classes() (pandas.io.formats.style.Styler method)
set_tooltips() (pandas.io.formats.style.Styler method)
set_uuid() (pandas.io.formats.style.Styler method)
set_value() (pandas.Index method)
SettingWithCopyError
SettingWithCopyWarning
shape (pandas.api.extensions.ExtensionArray property)
(pandas.DataFrame property)
(pandas.Index property)
(pandas.Series property)
sheets (pandas.ExcelWriter property)
shift() (pandas.api.extensions.ExtensionArray method)
(pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
show_versions() (in module pandas)
size (pandas.DataFrame property)
(pandas.Index property)
(pandas.Series property)
size() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
skew (pandas.core.groupby.DataFrameGroupBy property)
skew() (pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.DataFrame method)
(pandas.Series method)
slice() (pandas.Series.str method)
slice_indexer() (pandas.Index method)
slice_locs() (pandas.Index method)
slice_replace() (pandas.Series.str method)
slice_shift() (pandas.DataFrame method)
(pandas.Series method)
snap() (pandas.DatetimeIndex method)
sort() (pandas.Index method)
sort_index() (pandas.DataFrame method)
(pandas.Series method)
sort_values() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
sortlevel() (pandas.Index method)
(pandas.MultiIndex method)
sp_values (pandas.Series.sparse attribute)
sparse() (pandas.DataFrame method)
(pandas.Series method)
SparseArray (class in pandas.arrays)
SparseDtype (class in pandas)
SpecificationError
split() (pandas.Series.str method)
squeeze() (pandas.DataFrame method)
(pandas.Series method)
stack() (pandas.DataFrame method)
start (pandas.RangeIndex property)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
start_time (pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
startingMonth (pandas.tseries.offsets.BQuarterBegin attribute)
(pandas.tseries.offsets.BQuarterEnd attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.QuarterBegin attribute)
(pandas.tseries.offsets.QuarterEnd attribute)
startswith() (pandas.Series.str method)
std() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.ewm.ExponentialMovingWindow method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.core.window.rolling.Window method)
(pandas.DataFrame method)
(pandas.DatetimeIndex method)
(pandas.Series method)
step (pandas.RangeIndex property)
stop (pandas.RangeIndex property)
str() (pandas.Index method)
(pandas.Series method)
strftime() (pandas.DatetimeIndex method)
(pandas.Period method)
(pandas.PeriodIndex method)
(pandas.Series.dt method)
(pandas.Timestamp method)
StringArray (class in pandas.arrays)
StringDtype (class in pandas)
strip() (pandas.Series.str method)
strptime() (pandas.Timestamp class method)
style (pandas.DataFrame property)
Styler (class in pandas.io.formats.style)
sub() (pandas.DataFrame method)
(pandas.Series method)
subtract() (pandas.DataFrame method)
(pandas.Series method)
subtype (pandas.IntervalDtype property)
sum() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.ewm.ExponentialMovingWindow method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.core.window.rolling.Window method)
(pandas.DataFrame method)
(pandas.Series method)
supported_extensions (pandas.ExcelWriter property)
swapaxes() (pandas.DataFrame method)
(pandas.Series method)
swapcase() (pandas.Series.str method)
swaplevel() (pandas.DataFrame method)
(pandas.MultiIndex method)
(pandas.Series method)
symmetric_difference() (pandas.Index method)
T
T (pandas.DataFrame property)
(pandas.Index property)
(pandas.Series property)
table() (in module pandas.plotting)
tail() (pandas.core.groupby.GroupBy method)
(pandas.DataFrame method)
(pandas.Series method)
take (pandas.core.groupby.DataFrameGroupBy property)
take() (pandas.api.extensions.ExtensionArray method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
template_html (pandas.io.formats.style.Styler attribute)
template_html_style (pandas.io.formats.style.Styler attribute)
template_html_table (pandas.io.formats.style.Styler attribute)
template_latex (pandas.io.formats.style.Styler attribute)
template_string (pandas.io.formats.style.Styler attribute)
test() (in module pandas)
text_gradient() (pandas.io.formats.style.Styler method)
Tick (class in pandas.tseries.offsets)
time (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
time() (pandas.Timestamp method)
Timedelta (class in pandas)
timedelta_range() (in module pandas)
TimedeltaArray (class in pandas.arrays)
TimedeltaIndex (class in pandas)
Timestamp (class in pandas)
timestamp() (pandas.Timestamp method)
timetuple() (pandas.Timestamp method)
timetz (pandas.DatetimeIndex property)
(pandas.Series.dt attribute)
timetz() (pandas.Timestamp method)
title() (pandas.Series.str method)
to_clipboard() (pandas.DataFrame method)
(pandas.Series method)
to_coo() (pandas.DataFrame.sparse method)
(pandas.Series.sparse method)
to_csv() (pandas.DataFrame method)
(pandas.Series method)
to_datetime() (in module pandas)
to_datetime64() (pandas.Timestamp method)
to_dense() (pandas.DataFrame.sparse method)
to_dict() (pandas.DataFrame method)
(pandas.Series method)
to_excel() (pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
(pandas.Series method)
to_feather() (pandas.DataFrame method)
to_flat_index() (pandas.Index method)
(pandas.MultiIndex method)
to_frame() (pandas.DatetimeIndex method)
(pandas.Index method)
(pandas.MultiIndex method)
(pandas.Series method)
(pandas.TimedeltaIndex method)
to_gbq() (pandas.DataFrame method)
to_hdf() (pandas.DataFrame method)
(pandas.Series method)
to_html() (pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
to_json() (pandas.DataFrame method)
(pandas.Series method)
to_julian_date() (pandas.Timestamp method)
to_latex() (pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
(pandas.Series method)
to_list() (pandas.Index method)
(pandas.Series method)
to_markdown() (pandas.DataFrame method)
(pandas.Series method)
to_native_types() (pandas.Index method)
to_numeric() (in module pandas)
to_numpy() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
(pandas.Timedelta method)
(pandas.Timestamp method)
to_offset() (in module pandas.tseries.frequencies)
to_orc() (pandas.DataFrame method)
to_parquet() (pandas.DataFrame method)
to_period() (pandas.DataFrame method)
(pandas.DatetimeIndex method)
(pandas.Series method)
(pandas.Series.dt method)
(pandas.Timestamp method)
to_perioddelta() (pandas.DatetimeIndex method)
to_pickle() (pandas.DataFrame method)
(pandas.Series method)
to_pydatetime() (pandas.DatetimeIndex method)
(pandas.Series.dt method)
(pandas.Timestamp method)
to_pytimedelta() (pandas.Series.dt method)
(pandas.Timedelta method)
(pandas.TimedeltaIndex method)
to_records() (pandas.DataFrame method)
to_series() (pandas.DatetimeIndex method)
(pandas.Index method)
(pandas.TimedeltaIndex method)
to_sql() (pandas.DataFrame method)
(pandas.Series method)
to_stata() (pandas.DataFrame method)
to_string() (pandas.DataFrame method)
(pandas.io.formats.style.Styler method)
(pandas.Series method)
to_timedelta() (in module pandas)
to_timedelta64() (pandas.Timedelta method)
to_timestamp() (pandas.DataFrame method)
(pandas.Period method)
(pandas.PeriodIndex method)
(pandas.Series method)
to_tuples() (pandas.arrays.IntervalArray method)
(pandas.IntervalIndex method)
to_xarray() (pandas.DataFrame method)
(pandas.Series method)
to_xml() (pandas.DataFrame method)
today() (pandas.Timestamp class method)
tolist() (pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
toordinal() (pandas.Timestamp method)
total_seconds() (pandas.Series.dt method)
(pandas.Timedelta method)
transform() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.core.groupby.SeriesGroupBy method)
(pandas.core.resample.Resampler method)
(pandas.DataFrame method)
(pandas.Series method)
translate() (pandas.Series.str method)
transpose() (pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
truediv() (pandas.DataFrame method)
(pandas.Series method)
truncate() (pandas.DataFrame method)
(pandas.Series method)
tshift (pandas.core.groupby.DataFrameGroupBy property)
tshift() (pandas.DataFrame method)
(pandas.Series method)
type (pandas.api.extensions.ExtensionDtype property)
tz (pandas.DatetimeIndex property)
(pandas.DatetimeTZDtype property)
(pandas.Series.dt attribute)
(pandas.Timestamp property)
tz_convert() (pandas.DataFrame method)
(pandas.DatetimeIndex method)
(pandas.Series method)
(pandas.Series.dt method)
(pandas.Timestamp method)
tz_localize() (pandas.DataFrame method)
(pandas.DatetimeIndex method)
(pandas.Series method)
(pandas.Series.dt method)
(pandas.Timestamp method)
tzinfo (pandas.Timestamp attribute)
tzname() (pandas.Timestamp method)
U
UInt16Dtype (class in pandas)
UInt32Dtype (class in pandas)
UInt64Dtype (class in pandas)
UInt64Index (class in pandas)
UInt8Dtype (class in pandas)
UndefinedVariableError
union() (pandas.Index method)
union_categoricals() (in module pandas.api.types)
unique (pandas.core.groupby.SeriesGroupBy property)
unique() (in module pandas)
(pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
unit (pandas.DatetimeTZDtype property)
UnsortedIndexError
unstack() (pandas.DataFrame method)
(pandas.Series method)
UnsupportedFunctionCall
update() (pandas.DataFrame method)
(pandas.Series method)
upper() (pandas.Series.str method)
use() (pandas.io.formats.style.Styler method)
utcfromtimestamp() (pandas.Timestamp class method)
utcnow() (pandas.Timestamp class method)
utcoffset() (pandas.Timestamp method)
utctimetuple() (pandas.Timestamp method)
V
value (pandas.Timedelta attribute)
(pandas.Timestamp attribute)
value_counts() (pandas.core.groupby.DataFrameGroupBy method)
(pandas.DataFrame method)
(pandas.Index method)
(pandas.Series method)
value_labels() (pandas.io.stata.StataReader method)
ValueLabelTypeMismatch
values (pandas.DataFrame property)
(pandas.Index property)
(pandas.IntervalIndex property)
(pandas.Series property)
var() (pandas.core.groupby.GroupBy method)
(pandas.core.resample.Resampler method)
(pandas.core.window.ewm.ExponentialMovingWindow method)
(pandas.core.window.expanding.Expanding method)
(pandas.core.window.rolling.Rolling method)
(pandas.core.window.rolling.Window method)
(pandas.DataFrame method)
(pandas.Series method)
variable_labels() (pandas.io.stata.StataReader method)
VariableOffsetWindowIndexer (class in pandas.api.indexers)
variation (pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
view() (pandas.api.extensions.ExtensionArray method)
(pandas.Index method)
(pandas.Series method)
(pandas.Timedelta method)
W
walk() (pandas.HDFStore method)
Week (class in pandas.tseries.offsets)
week (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
weekday (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.tseries.offsets.FY5253 attribute)
(pandas.tseries.offsets.FY5253Quarter attribute)
(pandas.tseries.offsets.LastWeekOfMonth attribute)
(pandas.tseries.offsets.Week attribute)
(pandas.tseries.offsets.WeekOfMonth attribute)
weekday() (pandas.Timestamp method)
weekmask (pandas.tseries.offsets.BusinessDay attribute)
(pandas.tseries.offsets.BusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessDay attribute)
(pandas.tseries.offsets.CustomBusinessHour attribute)
(pandas.tseries.offsets.CustomBusinessMonthBegin attribute)
(pandas.tseries.offsets.CustomBusinessMonthEnd attribute)
WeekOfMonth (class in pandas.tseries.offsets)
weekofyear (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
where() (pandas.DataFrame method)
(pandas.Index method)
(pandas.io.formats.style.Styler method)
(pandas.Series method)
wide_to_long() (in module pandas)
wrap() (pandas.Series.str method)
write_cells() (pandas.ExcelWriter method)
write_file() (pandas.io.stata.StataWriter method)
X
xs() (pandas.DataFrame method)
(pandas.Series method)
Y
year (pandas.DatetimeIndex property)
(pandas.Period attribute)
(pandas.PeriodIndex property)
(pandas.Series.dt attribute)
(pandas.Timestamp attribute)
year_has_extra_week() (pandas.tseries.offsets.FY5253Quarter method)
YearBegin (class in pandas.tseries.offsets)
YearEnd (class in pandas.tseries.offsets)
Z
zfill() (pandas.Series.str method)
|
genindex.html
|
pandas.core.window.expanding.Expanding.mean
|
`pandas.core.window.expanding.Expanding.mean`
Calculate the expanding mean.
|
Expanding.mean(numeric_only=False, *args, engine=None, engine_kwargs=None, **kwargs)[source]#
Calculate the expanding mean.
Parameters
numeric_onlybool, default FalseInclude only float, int, boolean columns.
New in version 1.5.0.
*argsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
enginestr, default None
'cython' : Runs the operation through C-extensions from cython.
'numba' : Runs the operation through JIT compiled code from numba.
None : Defaults to 'cython' or globally setting compute.use_numba
New in version 1.3.0.
engine_kwargsdict, default None
For 'cython' engine, there are no accepted engine_kwargs
For 'numba' engine, the engine can accept nopython, nogil
and parallel dictionary keys. The values must either be True or
False. The default engine_kwargs for the 'numba' engine is
{'nopython': True, 'nogil': False, 'parallel': False}
New in version 1.3.0.
**kwargsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
Returns
Series or DataFrameReturn type is the same as the original object with np.float64 dtype.
See also
pandas.Series.expandingCalling expanding with Series data.
pandas.DataFrame.expandingCalling expanding with DataFrames.
pandas.Series.meanAggregating mean for Series.
pandas.DataFrame.meanAggregating mean for DataFrame.
Notes
See Numba engine and Numba (JIT compilation) for extended documentation and performance considerations for the Numba engine.
|
reference/api/pandas.core.window.expanding.Expanding.mean.html
|
pandas.tseries.offsets.YearBegin
|
`pandas.tseries.offsets.YearBegin`
DateOffset increments between calendar year begin dates.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> ts + pd.offsets.YearBegin()
Timestamp('2023-01-01 00:00:00')
```
|
class pandas.tseries.offsets.YearBegin#
DateOffset increments between calendar year begin dates.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> ts + pd.offsets.YearBegin()
Timestamp('2023-01-01 00:00:00')
Attributes
base
Returns a copy of the calling offset object with n=1 and all other attributes equal.
freqstr
Return a string representing the frequency.
kwds
Return a dict of extra parameters for the offset.
name
Return a string representing the base frequency.
month
n
nanos
normalize
rule_code
Methods
__call__(*args, **kwargs)
Call self as a function.
apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
copy
Return a copy of the frequency.
is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
is_month_end
Return boolean whether a timestamp occurs on the month end.
is_month_start
Return boolean whether a timestamp occurs on the month start.
is_on_offset
Return boolean whether a timestamp intersects with this frequency.
is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
is_year_end
Return boolean whether a timestamp occurs on the year end.
is_year_start
Return boolean whether a timestamp occurs on the year start.
rollback
Roll provided date backward to next offset only if not on offset.
rollforward
Roll provided date forward to next offset only if not on offset.
apply
isAnchored
onOffset
|
reference/api/pandas.tseries.offsets.YearBegin.html
|
pandas.tseries.offsets.BusinessMonthBegin.isAnchored
|
pandas.tseries.offsets.BusinessMonthBegin.isAnchored
|
BusinessMonthBegin.isAnchored()#
|
reference/api/pandas.tseries.offsets.BusinessMonthBegin.isAnchored.html
|
pandas.read_clipboard
|
`pandas.read_clipboard`
Read text from clipboard and pass to read_csv.
A string or regex delimiter. The default of ‘s+’ denotes
one or more whitespace characters.
|
pandas.read_clipboard(sep='\\s+', **kwargs)[source]#
Read text from clipboard and pass to read_csv.
Parameters
sepstr, default ‘s+’A string or regex delimiter. The default of ‘s+’ denotes
one or more whitespace characters.
**kwargsSee read_csv for the full argument list.
Returns
DataFrameA parsed DataFrame object.
|
reference/api/pandas.read_clipboard.html
|
pandas.read_csv
|
`pandas.read_csv`
Read a comma-separated values (csv) file into DataFrame.
```
>>> pd.read_csv('data.csv')
```
|
pandas.read_csv(filepath_or_buffer, *, sep=_NoDefault.no_default, delimiter=None, header='infer', names=_NoDefault.no_default, index_col=None, usecols=None, squeeze=None, prefix=_NoDefault.no_default, mangle_dupe_cols=True, dtype=None, engine=None, converters=None, true_values=None, false_values=None, skipinitialspace=False, skiprows=None, skipfooter=0, nrows=None, na_values=None, keep_default_na=True, na_filter=True, verbose=False, skip_blank_lines=True, parse_dates=None, infer_datetime_format=False, keep_date_col=False, date_parser=None, dayfirst=False, cache_dates=True, iterator=False, chunksize=None, compression='infer', thousands=None, decimal='.', lineterminator=None, quotechar='"', quoting=0, doublequote=True, escapechar=None, comment=None, encoding=None, encoding_errors='strict', dialect=None, error_bad_lines=None, warn_bad_lines=None, on_bad_lines=None, delim_whitespace=False, low_memory=True, memory_map=False, float_precision=None, storage_options=None)[source]#
Read a comma-separated values (csv) file into DataFrame.
Also supports optionally iterating or breaking of the file
into chunks.
Additional help can be found in the online docs for
IO Tools.
Parameters
filepath_or_bufferstr, path object or file-like objectAny valid string path is acceptable. The string could be a URL. Valid
URL schemes include http, ftp, s3, gs, and file. For file URLs, a host is
expected. A local file could be: file://localhost/path/to/table.csv.
If you want to pass in a path object, pandas accepts any os.PathLike.
By file-like object, we refer to objects with a read() method, such as
a file handle (e.g. via builtin open function) or StringIO.
sepstr, default ‘,’Delimiter to use. If sep is None, the C engine cannot automatically detect
the separator, but the Python parsing engine can, meaning the latter will
be used and automatically detect the separator by Python’s builtin sniffer
tool, csv.Sniffer. In addition, separators longer than 1 character and
different from '\s+' will be interpreted as regular expressions and
will also force the use of the Python parsing engine. Note that regex
delimiters are prone to ignoring quoted data. Regex example: '\r\t'.
delimiterstr, default NoneAlias for sep.
headerint, list of int, None, default ‘infer’Row number(s) to use as the column names, and the start of the
data. Default behavior is to infer the column names: if no names
are passed the behavior is identical to header=0 and column
names are inferred from the first line of the file, if column
names are passed explicitly then the behavior is identical to
header=None. Explicitly pass header=0 to be able to
replace existing names. The header can be a list of integers that
specify row locations for a multi-index on the columns
e.g. [0,1,3]. Intervening rows that are not specified will be
skipped (e.g. 2 in this example is skipped). Note that this
parameter ignores commented lines and empty lines if
skip_blank_lines=True, so header=0 denotes the first line of
data rather than the first line of the file.
namesarray-like, optionalList of column names to use. If the file contains a header row,
then you should explicitly pass header=0 to override the column names.
Duplicates in this list are not allowed.
index_colint, str, sequence of int / str, or False, optional, default NoneColumn(s) to use as the row labels of the DataFrame, either given as
string name or column index. If a sequence of int / str is given, a
MultiIndex is used.
Note: index_col=False can be used to force pandas to not use the first
column as the index, e.g. when you have a malformed file with delimiters at
the end of each line.
usecolslist-like or callable, optionalReturn a subset of the columns. If list-like, all elements must either
be positional (i.e. integer indices into the document columns) or strings
that correspond to column names provided either by the user in names or
inferred from the document header row(s). If names are given, the document
header row(s) are not taken into account. For example, a valid list-like
usecols parameter would be [0, 1, 2] or ['foo', 'bar', 'baz'].
Element order is ignored, so usecols=[0, 1] is the same as [1, 0].
To instantiate a DataFrame from data with element order preserved use
pd.read_csv(data, usecols=['foo', 'bar'])[['foo', 'bar']] for columns
in ['foo', 'bar'] order or
pd.read_csv(data, usecols=['foo', 'bar'])[['bar', 'foo']]
for ['bar', 'foo'] order.
If callable, the callable function will be evaluated against the column
names, returning names where the callable function evaluates to True. An
example of a valid callable argument would be lambda x: x.upper() in
['AAA', 'BBB', 'DDD']. Using this parameter results in much faster
parsing time and lower memory usage.
squeezebool, default FalseIf the parsed data only contains one column then return a Series.
Deprecated since version 1.4.0: Append .squeeze("columns") to the call to read_csv to squeeze
the data.
prefixstr, optionalPrefix to add to column numbers when no header, e.g. ‘X’ for X0, X1, …
Deprecated since version 1.4.0: Use a list comprehension on the DataFrame’s columns after calling read_csv.
mangle_dupe_colsbool, default TrueDuplicate columns will be specified as ‘X’, ‘X.1’, …’X.N’, rather than
‘X’…’X’. Passing in False will cause data to be overwritten if there
are duplicate names in the columns.
Deprecated since version 1.5.0: Not implemented, and a new argument to specify the pattern for the
names of duplicated columns will be added instead
dtypeType name or dict of column -> type, optionalData type for data or columns. E.g. {‘a’: np.float64, ‘b’: np.int32,
‘c’: ‘Int64’}
Use str or object together with suitable na_values settings
to preserve and not interpret dtype.
If converters are specified, they will be applied INSTEAD
of dtype conversion.
New in version 1.5.0: Support for defaultdict was added. Specify a defaultdict as input where
the default determines the dtype of the columns which are not explicitly
listed.
engine{‘c’, ‘python’, ‘pyarrow’}, optionalParser engine to use. The C and pyarrow engines are faster, while the python engine
is currently more feature-complete. Multithreading is currently only supported by
the pyarrow engine.
New in version 1.4.0: The “pyarrow” engine was added as an experimental engine, and some features
are unsupported, or may not work correctly, with this engine.
convertersdict, optionalDict of functions for converting values in certain columns. Keys can either
be integers or column labels.
true_valueslist, optionalValues to consider as True.
false_valueslist, optionalValues to consider as False.
skipinitialspacebool, default FalseSkip spaces after delimiter.
skiprowslist-like, int or callable, optionalLine numbers to skip (0-indexed) or number of lines to skip (int)
at the start of the file.
If callable, the callable function will be evaluated against the row
indices, returning True if the row should be skipped and False otherwise.
An example of a valid callable argument would be lambda x: x in [0, 2].
skipfooterint, default 0Number of lines at bottom of file to skip (Unsupported with engine=’c’).
nrowsint, optionalNumber of rows of file to read. Useful for reading pieces of large files.
na_valuesscalar, str, list-like, or dict, optionalAdditional strings to recognize as NA/NaN. If dict passed, specific
per-column NA values. By default the following values are interpreted as
NaN: ‘’, ‘#N/A’, ‘#N/A N/A’, ‘#NA’, ‘-1.#IND’, ‘-1.#QNAN’, ‘-NaN’, ‘-nan’,
‘1.#IND’, ‘1.#QNAN’, ‘<NA>’, ‘N/A’, ‘NA’, ‘NULL’, ‘NaN’, ‘n/a’,
‘nan’, ‘null’.
keep_default_nabool, default TrueWhether or not to include the default NaN values when parsing the data.
Depending on whether na_values is passed in, the behavior is as follows:
If keep_default_na is True, and na_values are specified, na_values
is appended to the default NaN values used for parsing.
If keep_default_na is True, and na_values are not specified, only
the default NaN values are used for parsing.
If keep_default_na is False, and na_values are specified, only
the NaN values specified na_values are used for parsing.
If keep_default_na is False, and na_values are not specified, no
strings will be parsed as NaN.
Note that if na_filter is passed in as False, the keep_default_na and
na_values parameters will be ignored.
na_filterbool, default TrueDetect missing value markers (empty strings and the value of na_values). In
data without any NAs, passing na_filter=False can improve the performance
of reading a large file.
verbosebool, default FalseIndicate number of NA values placed in non-numeric columns.
skip_blank_linesbool, default TrueIf True, skip over blank lines rather than interpreting as NaN values.
parse_datesbool or list of int or names or list of lists or dict, default FalseThe behavior is as follows:
boolean. If True -> try parsing the index.
list of int or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3
each as a separate date column.
list of lists. e.g. If [[1, 3]] -> combine columns 1 and 3 and parse as
a single date column.
dict, e.g. {‘foo’ : [1, 3]} -> parse columns 1, 3 as date and call
result ‘foo’
If a column or index cannot be represented as an array of datetimes,
say because of an unparsable value or a mixture of timezones, the column
or index will be returned unaltered as an object data type. For
non-standard datetime parsing, use pd.to_datetime after
pd.read_csv. To parse an index or column with a mixture of timezones,
specify date_parser to be a partially-applied
pandas.to_datetime() with utc=True. See
Parsing a CSV with mixed timezones for more.
Note: A fast-path exists for iso8601-formatted dates.
infer_datetime_formatbool, default FalseIf True and parse_dates is enabled, pandas will attempt to infer the
format of the datetime strings in the columns, and if it can be inferred,
switch to a faster method of parsing them. In some cases this can increase
the parsing speed by 5-10x.
keep_date_colbool, default FalseIf True and parse_dates specifies combining multiple columns then
keep the original columns.
date_parserfunction, optionalFunction to use for converting a sequence of string columns to an array of
datetime instances. The default uses dateutil.parser.parser to do the
conversion. Pandas will try to call date_parser in three different ways,
advancing to the next if an exception occurs: 1) Pass one or more arrays
(as defined by parse_dates) as arguments; 2) concatenate (row-wise) the
string values from the columns defined by parse_dates into a single array
and pass that; and 3) call date_parser once for each row using one or
more strings (corresponding to the columns defined by parse_dates) as
arguments.
dayfirstbool, default FalseDD/MM format dates, international and European format.
cache_datesbool, default TrueIf True, use a cache of unique, converted dates to apply the datetime
conversion. May produce significant speed-up when parsing duplicate
date strings, especially ones with timezone offsets.
New in version 0.25.0.
iteratorbool, default FalseReturn TextFileReader object for iteration or getting chunks with
get_chunk().
Changed in version 1.2: TextFileReader is a context manager.
chunksizeint, optionalReturn TextFileReader object for iteration.
See the IO Tools docs
for more information on iterator and chunksize.
Changed in version 1.2: TextFileReader is a context manager.
compressionstr or dict, default ‘infer’For on-the-fly decompression of on-disk data. If ‘infer’ and ‘filepath_or_buffer’ is
path-like, then detect compression from the following extensions: ‘.gz’,
‘.bz2’, ‘.zip’, ‘.xz’, ‘.zst’, ‘.tar’, ‘.tar.gz’, ‘.tar.xz’ or ‘.tar.bz2’
(otherwise no compression).
If using ‘zip’ or ‘tar’, the ZIP file must contain only one data file to be read in.
Set to None for no decompression.
Can also be a dict with key 'method' set
to one of {'zip', 'gzip', 'bz2', 'zstd', 'tar'} and other
key-value pairs are forwarded to
zipfile.ZipFile, gzip.GzipFile,
bz2.BZ2File, zstandard.ZstdDecompressor or
tarfile.TarFile, respectively.
As an example, the following could be passed for Zstandard decompression using a
custom compression dictionary:
compression={'method': 'zstd', 'dict_data': my_compression_dict}.
New in version 1.5.0: Added support for .tar files.
Changed in version 1.4.0: Zstandard support.
thousandsstr, optionalThousands separator.
decimalstr, default ‘.’Character to recognize as decimal point (e.g. use ‘,’ for European data).
lineterminatorstr (length 1), optionalCharacter to break file into lines. Only valid with C parser.
quotecharstr (length 1), optionalThe character used to denote the start and end of a quoted item. Quoted
items can include the delimiter and it will be ignored.
quotingint or csv.QUOTE_* instance, default 0Control field quoting behavior per csv.QUOTE_* constants. Use one of
QUOTE_MINIMAL (0), QUOTE_ALL (1), QUOTE_NONNUMERIC (2) or QUOTE_NONE (3).
doublequotebool, default TrueWhen quotechar is specified and quoting is not QUOTE_NONE, indicate
whether or not to interpret two consecutive quotechar elements INSIDE a
field as a single quotechar element.
escapecharstr (length 1), optionalOne-character string used to escape other characters.
commentstr, optionalIndicates remainder of line should not be parsed. If found at the beginning
of a line, the line will be ignored altogether. This parameter must be a
single character. Like empty lines (as long as skip_blank_lines=True),
fully commented lines are ignored by the parameter header but not by
skiprows. For example, if comment='#', parsing
#empty\na,b,c\n1,2,3 with header=0 will result in ‘a,b,c’ being
treated as the header.
encodingstr, optionalEncoding to use for UTF when reading/writing (ex. ‘utf-8’). List of Python
standard encodings .
Changed in version 1.2: When encoding is None, errors="replace" is passed to
open(). Otherwise, errors="strict" is passed to open().
This behavior was previously only the case for engine="python".
Changed in version 1.3.0: encoding_errors is a new argument. encoding has no longer an
influence on how encoding errors are handled.
encoding_errorsstr, optional, default “strict”How encoding errors are treated. List of possible values .
New in version 1.3.0.
dialectstr or csv.Dialect, optionalIf provided, this parameter will override values (default or not) for the
following parameters: delimiter, doublequote, escapechar,
skipinitialspace, quotechar, and quoting. If it is necessary to
override values, a ParserWarning will be issued. See csv.Dialect
documentation for more details.
error_bad_linesbool, optional, default NoneLines with too many fields (e.g. a csv line with too many commas) will by
default cause an exception to be raised, and no DataFrame will be returned.
If False, then these “bad lines” will be dropped from the DataFrame that is
returned.
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon
encountering a bad line instead.
warn_bad_linesbool, optional, default NoneIf error_bad_lines is False, and warn_bad_lines is True, a warning for each
“bad line” will be output.
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon
encountering a bad line instead.
on_bad_lines{‘error’, ‘warn’, ‘skip’} or callable, default ‘error’Specifies what to do upon encountering a bad line (a line with too many fields).
Allowed values are :
‘error’, raise an Exception when a bad line is encountered.
‘warn’, raise a warning when a bad line is encountered and skip that line.
‘skip’, skip bad lines without raising or warning when they are encountered.
New in version 1.3.0.
New in version 1.4.0:
callable, function with signature
(bad_line: list[str]) -> list[str] | None that will process a single
bad line. bad_line is a list of strings split by the sep.
If the function returns None, the bad line will be ignored.
If the function returns a new list of strings with more elements than
expected, a ParserWarning will be emitted while dropping extra elements.
Only supported when engine="python"
delim_whitespacebool, default FalseSpecifies whether or not whitespace (e.g. ' ' or ' ') will be
used as the sep. Equivalent to setting sep='\s+'. If this option
is set to True, nothing should be passed in for the delimiter
parameter.
low_memorybool, default TrueInternally process the file in chunks, resulting in lower memory use
while parsing, but possibly mixed type inference. To ensure no mixed
types either set False, or specify the type with the dtype parameter.
Note that the entire file is read into a single DataFrame regardless,
use the chunksize or iterator parameter to return the data in chunks.
(Only valid with C parser).
memory_mapbool, default FalseIf a filepath is provided for filepath_or_buffer, map the file object
directly onto memory and access the data directly from there. Using this
option can improve performance because there is no longer any I/O overhead.
float_precisionstr, optionalSpecifies which converter the C engine should use for floating-point
values. The options are None or ‘high’ for the ordinary converter,
‘legacy’ for the original lower precision pandas converter, and
‘round_trip’ for the round-trip converter.
Changed in version 1.2.
storage_optionsdict, optionalExtra options that make sense for a particular storage connection, e.g.
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
are forwarded to urllib.request.Request as header options. For other
URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are
forwarded to fsspec.open. Please see fsspec and urllib for more
details, and for more examples on storage options refer here.
New in version 1.2.
Returns
DataFrame or TextParserA comma-separated values (csv) file is returned as two-dimensional
data structure with labeled axes.
See also
DataFrame.to_csvWrite DataFrame to a comma-separated values (csv) file.
read_csvRead a comma-separated values (csv) file into DataFrame.
read_fwfRead a table of fixed-width formatted lines into DataFrame.
Examples
>>> pd.read_csv('data.csv')
|
reference/api/pandas.read_csv.html
|
pandas.tseries.offsets.Hour.copy
|
`pandas.tseries.offsets.Hour.copy`
Return a copy of the frequency.
```
>>> freq = pd.DateOffset(1)
>>> freq_copy = freq.copy()
>>> freq is freq_copy
False
```
|
Hour.copy()#
Return a copy of the frequency.
Examples
>>> freq = pd.DateOffset(1)
>>> freq_copy = freq.copy()
>>> freq is freq_copy
False
|
reference/api/pandas.tseries.offsets.Hour.copy.html
|
pandas.Series.argmax
|
`pandas.Series.argmax`
Return int position of the largest value in the Series.
If the maximum is achieved in multiple locations,
the first row position is returned.
```
>>> s = pd.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0,
... 'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0})
>>> s
Corn Flakes 100.0
Almond Delight 110.0
Cinnamon Toast Crunch 120.0
Cocoa Puff 110.0
dtype: float64
```
|
Series.argmax(axis=None, skipna=True, *args, **kwargs)[source]#
Return int position of the largest value in the Series.
If the maximum is achieved in multiple locations,
the first row position is returned.
Parameters
axis{None}Unused. Parameter needed for compatibility with DataFrame.
skipnabool, default TrueExclude NA/null values when showing the result.
*args, **kwargsAdditional arguments and keywords for compatibility with NumPy.
Returns
intRow position of the maximum value.
See also
Series.argmaxReturn position of the maximum value.
Series.argminReturn position of the minimum value.
numpy.ndarray.argmaxEquivalent method for numpy arrays.
Series.idxmaxReturn index label of the maximum values.
Series.idxminReturn index label of the minimum values.
Examples
Consider dataset containing cereal calories
>>> s = pd.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0,
... 'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0})
>>> s
Corn Flakes 100.0
Almond Delight 110.0
Cinnamon Toast Crunch 120.0
Cocoa Puff 110.0
dtype: float64
>>> s.argmax()
2
>>> s.argmin()
0
The maximum cereal calories is the third element and
the minimum cereal calories is the first element,
since series is zero-indexed.
|
reference/api/pandas.Series.argmax.html
|
pandas.Series.copy
|
`pandas.Series.copy`
Make a copy of this object’s indices and data.
```
>>> s = pd.Series([1, 2], index=["a", "b"])
>>> s
a 1
b 2
dtype: int64
```
|
Series.copy(deep=True)[source]#
Make a copy of this object’s indices and data.
When deep=True (default), a new object will be created with a
copy of the calling object’s data and indices. Modifications to
the data or indices of the copy will not be reflected in the
original object (see notes below).
When deep=False, a new object will be created without copying
the calling object’s data or index (only references to the data
and index are copied). Any changes to the data of the original
will be reflected in the shallow copy (and vice versa).
Parameters
deepbool, default TrueMake a deep copy, including a copy of the data and the indices.
With deep=False neither the indices nor the data are copied.
Returns
copySeries or DataFrameObject type matches caller.
Notes
When deep=True, data is copied but actual Python objects
will not be copied recursively, only the reference to the object.
This is in contrast to copy.deepcopy in the Standard Library,
which recursively copies object data (see examples below).
While Index objects are copied when deep=True, the underlying
numpy array is not copied for performance reasons. Since Index is
immutable, the underlying data can be safely shared and a copy
is not needed.
Since pandas is not thread safe, see the
gotchas when copying in a threading
environment.
Examples
>>> s = pd.Series([1, 2], index=["a", "b"])
>>> s
a 1
b 2
dtype: int64
>>> s_copy = s.copy()
>>> s_copy
a 1
b 2
dtype: int64
Shallow copy versus default (deep) copy:
>>> s = pd.Series([1, 2], index=["a", "b"])
>>> deep = s.copy()
>>> shallow = s.copy(deep=False)
Shallow copy shares data and index with original.
>>> s is shallow
False
>>> s.values is shallow.values and s.index is shallow.index
True
Deep copy has own copy of data and index.
>>> s is deep
False
>>> s.values is deep.values or s.index is deep.index
False
Updates to the data shared by shallow copy and original is reflected
in both; deep copy remains unchanged.
>>> s[0] = 3
>>> shallow[1] = 4
>>> s
a 3
b 4
dtype: int64
>>> shallow
a 3
b 4
dtype: int64
>>> deep
a 1
b 2
dtype: int64
Note that when copying an object containing Python objects, a deep copy
will copy the data, but will not do so recursively. Updating a nested
data object will be reflected in the deep copy.
>>> s = pd.Series([[1, 2], [3, 4]])
>>> deep = s.copy()
>>> s[0][0] = 10
>>> s
0 [10, 2]
1 [3, 4]
dtype: object
>>> deep
0 [10, 2]
1 [3, 4]
dtype: object
|
reference/api/pandas.Series.copy.html
|
pandas.DataFrame.radd
|
`pandas.DataFrame.radd`
Get Addition of dataframe and other, element-wise (binary operator radd).
```
>>> df = pd.DataFrame({'angles': [0, 3, 4],
... 'degrees': [360, 180, 360]},
... index=['circle', 'triangle', 'rectangle'])
>>> df
angles degrees
circle 0 360
triangle 3 180
rectangle 4 360
```
|
DataFrame.radd(other, axis='columns', level=None, fill_value=None)[source]#
Get Addition of dataframe and other, element-wise (binary operator radd).
Equivalent to other + dataframe, but with support to substitute a fill_value
for missing data in one of the inputs. With reverse version, add.
Among flexible wrappers (add, sub, mul, div, mod, pow) to
arithmetic operators: +, -, *, /, //, %, **.
Parameters
otherscalar, sequence, Series, dict or DataFrameAny single or multiple element data structure, or list-like object.
axis{0 or ‘index’, 1 or ‘columns’}Whether to compare by the index (0 or ‘index’) or columns.
(1 or ‘columns’). For Series input, axis to match Series index on.
levelint or labelBroadcast across a level, matching Index values on the
passed MultiIndex level.
fill_valuefloat or None, default NoneFill existing missing (NaN) values, and any new element needed for
successful DataFrame alignment, with this value before computation.
If data in both corresponding DataFrame locations is missing
the result will be missing.
Returns
DataFrameResult of the arithmetic operation.
See also
DataFrame.addAdd DataFrames.
DataFrame.subSubtract DataFrames.
DataFrame.mulMultiply DataFrames.
DataFrame.divDivide DataFrames (float division).
DataFrame.truedivDivide DataFrames (float division).
DataFrame.floordivDivide DataFrames (integer division).
DataFrame.modCalculate modulo (remainder after division).
DataFrame.powCalculate exponential power.
Notes
Mismatched indices will be unioned together.
Examples
>>> df = pd.DataFrame({'angles': [0, 3, 4],
... 'degrees': [360, 180, 360]},
... index=['circle', 'triangle', 'rectangle'])
>>> df
angles degrees
circle 0 360
triangle 3 180
rectangle 4 360
Add a scalar with operator version which return the same
results.
>>> df + 1
angles degrees
circle 1 361
triangle 4 181
rectangle 5 361
>>> df.add(1)
angles degrees
circle 1 361
triangle 4 181
rectangle 5 361
Divide by constant with reverse version.
>>> df.div(10)
angles degrees
circle 0.0 36.0
triangle 0.3 18.0
rectangle 0.4 36.0
>>> df.rdiv(10)
angles degrees
circle inf 0.027778
triangle 3.333333 0.055556
rectangle 2.500000 0.027778
Subtract a list and Series by axis with operator version.
>>> df - [1, 2]
angles degrees
circle -1 358
triangle 2 178
rectangle 3 358
>>> df.sub([1, 2], axis='columns')
angles degrees
circle -1 358
triangle 2 178
rectangle 3 358
>>> df.sub(pd.Series([1, 1, 1], index=['circle', 'triangle', 'rectangle']),
... axis='index')
angles degrees
circle -1 359
triangle 2 179
rectangle 3 359
Multiply a dictionary by axis.
>>> df.mul({'angles': 0, 'degrees': 2})
angles degrees
circle 0 720
triangle 0 360
rectangle 0 720
>>> df.mul({'circle': 0, 'triangle': 2, 'rectangle': 3}, axis='index')
angles degrees
circle 0 0
triangle 6 360
rectangle 12 1080
Multiply a DataFrame of different shape with operator version.
>>> other = pd.DataFrame({'angles': [0, 3, 4]},
... index=['circle', 'triangle', 'rectangle'])
>>> other
angles
circle 0
triangle 3
rectangle 4
>>> df * other
angles degrees
circle 0 NaN
triangle 9 NaN
rectangle 16 NaN
>>> df.mul(other, fill_value=0)
angles degrees
circle 0 0.0
triangle 9 0.0
rectangle 16 0.0
Divide by a MultiIndex by level.
>>> df_multindex = pd.DataFrame({'angles': [0, 3, 4, 4, 5, 6],
... 'degrees': [360, 180, 360, 360, 540, 720]},
... index=[['A', 'A', 'A', 'B', 'B', 'B'],
... ['circle', 'triangle', 'rectangle',
... 'square', 'pentagon', 'hexagon']])
>>> df_multindex
angles degrees
A circle 0 360
triangle 3 180
rectangle 4 360
B square 4 360
pentagon 5 540
hexagon 6 720
>>> df.div(df_multindex, level=1, fill_value=0)
angles degrees
A circle NaN 1.0
triangle 1.0 1.0
rectangle 1.0 1.0
B square 0.0 0.0
pentagon 0.0 0.0
hexagon 0.0 0.0
|
reference/api/pandas.DataFrame.radd.html
|
pandas.core.window.rolling.Window.mean
|
`pandas.core.window.rolling.Window.mean`
Calculate the rolling weighted window mean.
|
Window.mean(numeric_only=False, *args, **kwargs)[source]#
Calculate the rolling weighted window mean.
Parameters
numeric_onlybool, default FalseInclude only float, int, boolean columns.
New in version 1.5.0.
**kwargsKeyword arguments to configure the SciPy weighted window type.
Returns
Series or DataFrameReturn type is the same as the original object with np.float64 dtype.
See also
pandas.Series.rollingCalling rolling with Series data.
pandas.DataFrame.rollingCalling rolling with DataFrames.
pandas.Series.meanAggregating mean for Series.
pandas.DataFrame.meanAggregating mean for DataFrame.
|
reference/api/pandas.core.window.rolling.Window.mean.html
|
pandas.Index.slice_indexer
|
`pandas.Index.slice_indexer`
Compute the slice indexer for input labels and step.
```
>>> idx = pd.Index(list('abcd'))
>>> idx.slice_indexer(start='b', end='c')
slice(1, 3, None)
```
|
Index.slice_indexer(start=None, end=None, step=None, kind=_NoDefault.no_default)[source]#
Compute the slice indexer for input labels and step.
Index needs to be ordered and unique.
Parameters
startlabel, default NoneIf None, defaults to the beginning.
endlabel, default NoneIf None, defaults to the end.
stepint, default None
kindstr, default None
Deprecated since version 1.4.0.
Returns
indexerslice
Raises
KeyErrorIf key does not exist, or key is not unique and index isnot ordered.
Notes
This function assumes that the data is sorted, so use at your own peril
Examples
This is a method on all index types. For example you can do:
>>> idx = pd.Index(list('abcd'))
>>> idx.slice_indexer(start='b', end='c')
slice(1, 3, None)
>>> idx = pd.MultiIndex.from_arrays([list('abcd'), list('efgh')])
>>> idx.slice_indexer(start='b', end=('c', 'g'))
slice(1, 3, None)
|
reference/api/pandas.Index.slice_indexer.html
|
pandas.core.groupby.GroupBy.last
|
`pandas.core.groupby.GroupBy.last`
Compute the last non-null entry of each column.
```
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[5, None, 6], C=[1, 2, 3]))
>>> df.groupby("A").last()
B C
A
1 5.0 2
3 6.0 3
```
|
final GroupBy.last(numeric_only=False, min_count=- 1)[source]#
Compute the last non-null entry of each column.
Parameters
numeric_onlybool, default FalseInclude only float, int, boolean columns. If None, will attempt to use
everything, then use only numeric data.
min_countint, default -1The required number of valid values to perform the operation. If fewer
than min_count non-NA values are present the result will be NA.
Returns
Series or DataFrameLast non-null of values within each group.
See also
DataFrame.groupbyApply a function groupby to each row or column of a DataFrame.
DataFrame.core.groupby.GroupBy.firstCompute the first non-null entry of each column.
DataFrame.core.groupby.GroupBy.nthTake the nth row from each group.
Examples
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[5, None, 6], C=[1, 2, 3]))
>>> df.groupby("A").last()
B C
A
1 5.0 2
3 6.0 3
|
reference/api/pandas.core.groupby.GroupBy.last.html
|
pandas.MultiIndex.nlevels
|
`pandas.MultiIndex.nlevels`
Integer number of levels in this MultiIndex.
```
>>> mi = pd.MultiIndex.from_arrays([['a'], ['b'], ['c']])
>>> mi
MultiIndex([('a', 'b', 'c')],
)
>>> mi.nlevels
3
```
|
property MultiIndex.nlevels[source]#
Integer number of levels in this MultiIndex.
Examples
>>> mi = pd.MultiIndex.from_arrays([['a'], ['b'], ['c']])
>>> mi
MultiIndex([('a', 'b', 'c')],
)
>>> mi.nlevels
3
|
reference/api/pandas.MultiIndex.nlevels.html
|
pandas.Series.max
|
`pandas.Series.max`
Return the maximum of the values over the requested axis.
```
>>> idx = pd.MultiIndex.from_arrays([
... ['warm', 'warm', 'cold', 'cold'],
... ['dog', 'falcon', 'fish', 'spider']],
... names=['blooded', 'animal'])
>>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx)
>>> s
blooded animal
warm dog 4
falcon 2
cold fish 0
spider 8
Name: legs, dtype: int64
```
|
Series.max(axis=_NoDefault.no_default, skipna=True, level=None, numeric_only=None, **kwargs)[source]#
Return the maximum of the values over the requested axis.
If you want the index of the maximum, use idxmax. This is the equivalent of the numpy.ndarray method argmax.
Parameters
axis{index (0)}Axis for the function to be applied on.
For Series this parameter is unused and defaults to 0.
skipnabool, default TrueExclude NA/null values when computing the result.
levelint or level name, default NoneIf the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a scalar.
Deprecated since version 1.3.0: The level keyword is deprecated. Use groupby instead.
numeric_onlybool, default NoneInclude only float, int, boolean columns. If None, will attempt to use
everything, then use only numeric data. Not implemented for Series.
Deprecated since version 1.5.0: Specifying numeric_only=None is deprecated. The default value will be
False in a future version of pandas.
**kwargsAdditional keyword arguments to be passed to the function.
Returns
scalar or Series (if level specified)
See also
Series.sumReturn the sum.
Series.minReturn the minimum.
Series.maxReturn the maximum.
Series.idxminReturn the index of the minimum.
Series.idxmaxReturn the index of the maximum.
DataFrame.sumReturn the sum over the requested axis.
DataFrame.minReturn the minimum over the requested axis.
DataFrame.maxReturn the maximum over the requested axis.
DataFrame.idxminReturn the index of the minimum over the requested axis.
DataFrame.idxmaxReturn the index of the maximum over the requested axis.
Examples
>>> idx = pd.MultiIndex.from_arrays([
... ['warm', 'warm', 'cold', 'cold'],
... ['dog', 'falcon', 'fish', 'spider']],
... names=['blooded', 'animal'])
>>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx)
>>> s
blooded animal
warm dog 4
falcon 2
cold fish 0
spider 8
Name: legs, dtype: int64
>>> s.max()
8
|
reference/api/pandas.Series.max.html
|
pandas.TimedeltaIndex.inferred_freq
|
`pandas.TimedeltaIndex.inferred_freq`
Tries to return a string representing a frequency generated by infer_freq.
|
TimedeltaIndex.inferred_freq[source]#
Tries to return a string representing a frequency generated by infer_freq.
Returns None if it can’t autodetect the frequency.
|
reference/api/pandas.TimedeltaIndex.inferred_freq.html
|
pandas.plotting.register_matplotlib_converters
|
`pandas.plotting.register_matplotlib_converters`
Register pandas formatters and converters with matplotlib.
|
pandas.plotting.register_matplotlib_converters()[source]#
Register pandas formatters and converters with matplotlib.
This function modifies the global matplotlib.units.registry
dictionary. pandas adds custom converters for
pd.Timestamp
pd.Period
np.datetime64
datetime.datetime
datetime.date
datetime.time
See also
deregister_matplotlib_convertersRemove pandas formatters and converters.
|
reference/api/pandas.plotting.register_matplotlib_converters.html
|
pandas.Series.dt.microsecond
|
`pandas.Series.dt.microsecond`
The microseconds of the datetime.
Examples
```
>>> datetime_series = pd.Series(
... pd.date_range("2000-01-01", periods=3, freq="us")
... )
>>> datetime_series
0 2000-01-01 00:00:00.000000
1 2000-01-01 00:00:00.000001
2 2000-01-01 00:00:00.000002
dtype: datetime64[ns]
>>> datetime_series.dt.microsecond
0 0
1 1
2 2
dtype: int64
```
|
Series.dt.microsecond[source]#
The microseconds of the datetime.
Examples
>>> datetime_series = pd.Series(
... pd.date_range("2000-01-01", periods=3, freq="us")
... )
>>> datetime_series
0 2000-01-01 00:00:00.000000
1 2000-01-01 00:00:00.000001
2 2000-01-01 00:00:00.000002
dtype: datetime64[ns]
>>> datetime_series.dt.microsecond
0 0
1 1
2 2
dtype: int64
|
reference/api/pandas.Series.dt.microsecond.html
|
pandas.api.extensions.ExtensionArray.equals
|
`pandas.api.extensions.ExtensionArray.equals`
Return if another array is equivalent to this array.
|
ExtensionArray.equals(other)[source]#
Return if another array is equivalent to this array.
Equivalent means that both arrays have the same shape and dtype, and
all values compare equal. Missing values in the same location are
considered equal (in contrast with normal equality).
Parameters
otherExtensionArrayArray to compare to this Array.
Returns
booleanWhether the arrays are equivalent.
|
reference/api/pandas.api.extensions.ExtensionArray.equals.html
|
pandas.tseries.offsets.BusinessMonthEnd.is_month_start
|
`pandas.tseries.offsets.BusinessMonthEnd.is_month_start`
Return boolean whether a timestamp occurs on the month start.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_start(ts)
True
```
|
BusinessMonthEnd.is_month_start()#
Return boolean whether a timestamp occurs on the month start.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_start(ts)
True
|
reference/api/pandas.tseries.offsets.BusinessMonthEnd.is_month_start.html
|
pandas.DataFrame.eq
|
`pandas.DataFrame.eq`
Get Equal to of dataframe and other, element-wise (binary operator eq).
```
>>> df = pd.DataFrame({'cost': [250, 150, 100],
... 'revenue': [100, 250, 300]},
... index=['A', 'B', 'C'])
>>> df
cost revenue
A 250 100
B 150 250
C 100 300
```
|
DataFrame.eq(other, axis='columns', level=None)[source]#
Get Equal to of dataframe and other, element-wise (binary operator eq).
Among flexible wrappers (eq, ne, le, lt, ge, gt) to comparison
operators.
Equivalent to ==, !=, <=, <, >=, > with support to choose axis
(rows or columns) and level for comparison.
Parameters
otherscalar, sequence, Series, or DataFrameAny single or multiple element data structure, or list-like object.
axis{0 or ‘index’, 1 or ‘columns’}, default ‘columns’Whether to compare by the index (0 or ‘index’) or columns
(1 or ‘columns’).
levelint or labelBroadcast across a level, matching Index values on the passed
MultiIndex level.
Returns
DataFrame of boolResult of the comparison.
See also
DataFrame.eqCompare DataFrames for equality elementwise.
DataFrame.neCompare DataFrames for inequality elementwise.
DataFrame.leCompare DataFrames for less than inequality or equality elementwise.
DataFrame.ltCompare DataFrames for strictly less than inequality elementwise.
DataFrame.geCompare DataFrames for greater than inequality or equality elementwise.
DataFrame.gtCompare DataFrames for strictly greater than inequality elementwise.
Notes
Mismatched indices will be unioned together.
NaN values are considered different (i.e. NaN != NaN).
Examples
>>> df = pd.DataFrame({'cost': [250, 150, 100],
... 'revenue': [100, 250, 300]},
... index=['A', 'B', 'C'])
>>> df
cost revenue
A 250 100
B 150 250
C 100 300
Comparison with a scalar, using either the operator or method:
>>> df == 100
cost revenue
A False True
B False False
C True False
>>> df.eq(100)
cost revenue
A False True
B False False
C True False
When other is a Series, the columns of a DataFrame are aligned
with the index of other and broadcast:
>>> df != pd.Series([100, 250], index=["cost", "revenue"])
cost revenue
A True True
B True False
C False True
Use the method to control the broadcast axis:
>>> df.ne(pd.Series([100, 300], index=["A", "D"]), axis='index')
cost revenue
A True False
B True True
C True True
D True True
When comparing to an arbitrary sequence, the number of columns must
match the number elements in other:
>>> df == [250, 100]
cost revenue
A True True
B False False
C False False
Use the method to control the axis:
>>> df.eq([250, 250, 100], axis='index')
cost revenue
A True False
B False True
C True False
Compare to a DataFrame of different shape.
>>> other = pd.DataFrame({'revenue': [300, 250, 100, 150]},
... index=['A', 'B', 'C', 'D'])
>>> other
revenue
A 300
B 250
C 100
D 150
>>> df.gt(other)
cost revenue
A False False
B False False
C False True
D False False
Compare to a MultiIndex by level.
>>> df_multindex = pd.DataFrame({'cost': [250, 150, 100, 150, 300, 220],
... 'revenue': [100, 250, 300, 200, 175, 225]},
... index=[['Q1', 'Q1', 'Q1', 'Q2', 'Q2', 'Q2'],
... ['A', 'B', 'C', 'A', 'B', 'C']])
>>> df_multindex
cost revenue
Q1 A 250 100
B 150 250
C 100 300
Q2 A 150 200
B 300 175
C 220 225
>>> df.le(df_multindex, level=1)
cost revenue
Q1 A True True
B True True
C True True
Q2 A False True
B True False
C True False
|
reference/api/pandas.DataFrame.eq.html
|
pandas.tseries.offsets.QuarterBegin.startingMonth
|
pandas.tseries.offsets.QuarterBegin.startingMonth
|
QuarterBegin.startingMonth#
|
reference/api/pandas.tseries.offsets.QuarterBegin.startingMonth.html
|
pandas.tseries.offsets.CBMonthEnd
|
`pandas.tseries.offsets.CBMonthEnd`
alias of pandas._libs.tslibs.offsets.CustomBusinessMonthEnd
|
pandas.tseries.offsets.CBMonthEnd#
alias of pandas._libs.tslibs.offsets.CustomBusinessMonthEnd
|
reference/api/pandas.tseries.offsets.CBMonthEnd.html
|
pandas.DataFrame.infer_objects
|
`pandas.DataFrame.infer_objects`
Attempt to infer better dtypes for object columns.
```
>>> df = pd.DataFrame({"A": ["a", 1, 2, 3]})
>>> df = df.iloc[1:]
>>> df
A
1 1
2 2
3 3
```
|
DataFrame.infer_objects()[source]#
Attempt to infer better dtypes for object columns.
Attempts soft conversion of object-dtyped
columns, leaving non-object and unconvertible
columns unchanged. The inference rules are the
same as during normal Series/DataFrame construction.
Returns
convertedsame type as input object
See also
to_datetimeConvert argument to datetime.
to_timedeltaConvert argument to timedelta.
to_numericConvert argument to numeric type.
convert_dtypesConvert argument to best possible dtype.
Examples
>>> df = pd.DataFrame({"A": ["a", 1, 2, 3]})
>>> df = df.iloc[1:]
>>> df
A
1 1
2 2
3 3
>>> df.dtypes
A object
dtype: object
>>> df.infer_objects().dtypes
A int64
dtype: object
|
reference/api/pandas.DataFrame.infer_objects.html
|
pandas.tseries.offsets.Week.is_quarter_start
|
`pandas.tseries.offsets.Week.is_quarter_start`
Return boolean whether a timestamp occurs on the quarter start.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_quarter_start(ts)
True
```
|
Week.is_quarter_start()#
Return boolean whether a timestamp occurs on the quarter start.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_quarter_start(ts)
True
|
reference/api/pandas.tseries.offsets.Week.is_quarter_start.html
|
pandas.tseries.offsets.YearEnd.is_month_end
|
`pandas.tseries.offsets.YearEnd.is_month_end`
Return boolean whether a timestamp occurs on the month end.
Examples
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_end(ts)
False
```
|
YearEnd.is_month_end()#
Return boolean whether a timestamp occurs on the month end.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_end(ts)
False
|
reference/api/pandas.tseries.offsets.YearEnd.is_month_end.html
|
pandas.Index.get_indexer
|
`pandas.Index.get_indexer`
Compute indexer and mask for new index given the current index.
```
>>> index = pd.Index(['c', 'a', 'b'])
>>> index.get_indexer(['a', 'b', 'x'])
array([ 1, 2, -1])
```
|
final Index.get_indexer(target, method=None, limit=None, tolerance=None)[source]#
Compute indexer and mask for new index given the current index.
The indexer should be then used as an input to ndarray.take to align the
current data to the new index.
Parameters
targetIndex
method{None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional
default: exact matches only.
pad / ffill: find the PREVIOUS index value if no exact match.
backfill / bfill: use NEXT index value if no exact match
nearest: use the NEAREST index value if no exact match. Tied
distances are broken by preferring the larger index value.
limitint, optionalMaximum number of consecutive labels in target to match for
inexact matches.
toleranceoptionalMaximum distance between original and new labels for inexact
matches. The values of the index at the matching locations must
satisfy the equation abs(index[indexer] - target) <= tolerance.
Tolerance may be a scalar value, which applies the same tolerance
to all values, or list-like, which applies variable tolerance per
element. List-like includes list, tuple, array, Series, and must be
the same size as the index and its dtype must exactly match the
index’s type.
Returns
indexernp.ndarray[np.intp]Integers from 0 to n - 1 indicating that the index at these
positions matches the corresponding target values. Missing values
in the target are marked by -1.
Notes
Returns -1 for unmatched values, for further explanation see the
example below.
Examples
>>> index = pd.Index(['c', 'a', 'b'])
>>> index.get_indexer(['a', 'b', 'x'])
array([ 1, 2, -1])
Notice that the return value is an array of locations in index
and x is marked by -1, as it is not in index.
|
reference/api/pandas.Index.get_indexer.html
|
pandas.Series.dtype
|
`pandas.Series.dtype`
Return the dtype object of the underlying data.
|
property Series.dtype[source]#
Return the dtype object of the underlying data.
|
reference/api/pandas.Series.dtype.html
|
pandas.Series.dt.is_leap_year
|
`pandas.Series.dt.is_leap_year`
Boolean indicator if the date belongs to a leap year.
```
>>> idx = pd.date_range("2012-01-01", "2015-01-01", freq="Y")
>>> idx
DatetimeIndex(['2012-12-31', '2013-12-31', '2014-12-31'],
dtype='datetime64[ns]', freq='A-DEC')
>>> idx.is_leap_year
array([ True, False, False])
```
|
Series.dt.is_leap_year[source]#
Boolean indicator if the date belongs to a leap year.
A leap year is a year, which has 366 days (instead of 365) including
29th of February as an intercalary day.
Leap years are years which are multiples of four with the exception
of years divisible by 100 but not by 400.
Returns
Series or ndarrayBooleans indicating if dates belong to a leap year.
Examples
This method is available on Series with datetime values under
the .dt accessor, and directly on DatetimeIndex.
>>> idx = pd.date_range("2012-01-01", "2015-01-01", freq="Y")
>>> idx
DatetimeIndex(['2012-12-31', '2013-12-31', '2014-12-31'],
dtype='datetime64[ns]', freq='A-DEC')
>>> idx.is_leap_year
array([ True, False, False])
>>> dates_series = pd.Series(idx)
>>> dates_series
0 2012-12-31
1 2013-12-31
2 2014-12-31
dtype: datetime64[ns]
>>> dates_series.dt.is_leap_year
0 True
1 False
2 False
dtype: bool
|
reference/api/pandas.Series.dt.is_leap_year.html
|
pandas.api.types.is_float
|
`pandas.api.types.is_float`
Return True if given object is float.
|
pandas.api.types.is_float()#
Return True if given object is float.
Returns
bool
|
reference/api/pandas.api.types.is_float.html
|
Merge, join, concatenate and compare
|
Merge, join, concatenate and compare
pandas provides various facilities for easily combining together Series or
DataFrame with various kinds of set logic for the indexes
and relational algebra functionality in the case of join / merge-type
operations.
In addition, pandas also provides utilities to compare two Series or DataFrame
and summarize their differences.
The concat() function (in the main pandas namespace) does all of
the heavy lifting of performing concatenation operations along an axis while
performing optional set logic (union or intersection) of the indexes (if any) on
the other axes. Note that I say “if any” because there is only a single possible
axis of concatenation for Series.
Before diving into all of the details of concat and what it can do, here is
a simple example:
Like its sibling function on ndarrays, numpy.concatenate, pandas.concat
takes a list or dict of homogeneously-typed objects and concatenates them with
some configurable handling of “what to do with the other axes”:
|
pandas provides various facilities for easily combining together Series or
DataFrame with various kinds of set logic for the indexes
and relational algebra functionality in the case of join / merge-type
operations.
In addition, pandas also provides utilities to compare two Series or DataFrame
and summarize their differences.
Concatenating objects#
The concat() function (in the main pandas namespace) does all of
the heavy lifting of performing concatenation operations along an axis while
performing optional set logic (union or intersection) of the indexes (if any) on
the other axes. Note that I say “if any” because there is only a single possible
axis of concatenation for Series.
Before diving into all of the details of concat and what it can do, here is
a simple example:
In [1]: df1 = pd.DataFrame(
...: {
...: "A": ["A0", "A1", "A2", "A3"],
...: "B": ["B0", "B1", "B2", "B3"],
...: "C": ["C0", "C1", "C2", "C3"],
...: "D": ["D0", "D1", "D2", "D3"],
...: },
...: index=[0, 1, 2, 3],
...: )
...:
In [2]: df2 = pd.DataFrame(
...: {
...: "A": ["A4", "A5", "A6", "A7"],
...: "B": ["B4", "B5", "B6", "B7"],
...: "C": ["C4", "C5", "C6", "C7"],
...: "D": ["D4", "D5", "D6", "D7"],
...: },
...: index=[4, 5, 6, 7],
...: )
...:
In [3]: df3 = pd.DataFrame(
...: {
...: "A": ["A8", "A9", "A10", "A11"],
...: "B": ["B8", "B9", "B10", "B11"],
...: "C": ["C8", "C9", "C10", "C11"],
...: "D": ["D8", "D9", "D10", "D11"],
...: },
...: index=[8, 9, 10, 11],
...: )
...:
In [4]: frames = [df1, df2, df3]
In [5]: result = pd.concat(frames)
Like its sibling function on ndarrays, numpy.concatenate, pandas.concat
takes a list or dict of homogeneously-typed objects and concatenates them with
some configurable handling of “what to do with the other axes”:
pd.concat(
objs,
axis=0,
join="outer",
ignore_index=False,
keys=None,
levels=None,
names=None,
verify_integrity=False,
copy=True,
)
objs : a sequence or mapping of Series or DataFrame objects. If a
dict is passed, the sorted keys will be used as the keys argument, unless
it is passed, in which case the values will be selected (see below). Any None
objects will be dropped silently unless they are all None in which case a
ValueError will be raised.
axis : {0, 1, …}, default 0. The axis to concatenate along.
join : {‘inner’, ‘outer’}, default ‘outer’. How to handle indexes on
other axis(es). Outer for union and inner for intersection.
ignore_index : boolean, default False. If True, do not use the index
values on the concatenation axis. The resulting axis will be labeled 0, …,
n - 1. This is useful if you are concatenating objects where the
concatenation axis does not have meaningful indexing information. Note
the index values on the other axes are still respected in the join.
keys : sequence, default None. Construct hierarchical index using the
passed keys as the outermost level. If multiple levels passed, should
contain tuples.
levels : list of sequences, default None. Specific levels (unique values)
to use for constructing a MultiIndex. Otherwise they will be inferred from the
keys.
names : list, default None. Names for the levels in the resulting
hierarchical index.
verify_integrity : boolean, default False. Check whether the new
concatenated axis contains duplicates. This can be very expensive relative
to the actual data concatenation.
copy : boolean, default True. If False, do not copy data unnecessarily.
Without a little bit of context many of these arguments don’t make much sense.
Let’s revisit the above example. Suppose we wanted to associate specific keys
with each of the pieces of the chopped up DataFrame. We can do this using the
keys argument:
In [6]: result = pd.concat(frames, keys=["x", "y", "z"])
As you can see (if you’ve read the rest of the documentation), the resulting
object’s index has a hierarchical index. This
means that we can now select out each chunk by key:
In [7]: result.loc["y"]
Out[7]:
A B C D
4 A4 B4 C4 D4
5 A5 B5 C5 D5
6 A6 B6 C6 D6
7 A7 B7 C7 D7
It’s not a stretch to see how this can be very useful. More detail on this
functionality below.
Note
It is worth noting that concat() (and therefore
append()) makes a full copy of the data, and that constantly
reusing this function can create a significant performance hit. If you need
to use the operation over several datasets, use a list comprehension.
frames = [ process_your_file(f) for f in files ]
result = pd.concat(frames)
Note
When concatenating DataFrames with named axes, pandas will attempt to preserve
these index/column names whenever possible. In the case where all inputs share a
common name, this name will be assigned to the result. When the input names do
not all agree, the result will be unnamed. The same is true for MultiIndex,
but the logic is applied separately on a level-by-level basis.
Set logic on the other axes#
When gluing together multiple DataFrames, you have a choice of how to handle
the other axes (other than the one being concatenated). This can be done in
the following two ways:
Take the union of them all, join='outer'. This is the default
option as it results in zero information loss.
Take the intersection, join='inner'.
Here is an example of each of these methods. First, the default join='outer'
behavior:
In [8]: df4 = pd.DataFrame(
...: {
...: "B": ["B2", "B3", "B6", "B7"],
...: "D": ["D2", "D3", "D6", "D7"],
...: "F": ["F2", "F3", "F6", "F7"],
...: },
...: index=[2, 3, 6, 7],
...: )
...:
In [9]: result = pd.concat([df1, df4], axis=1)
Here is the same thing with join='inner':
In [10]: result = pd.concat([df1, df4], axis=1, join="inner")
Lastly, suppose we just wanted to reuse the exact index from the original
DataFrame:
In [11]: result = pd.concat([df1, df4], axis=1).reindex(df1.index)
Similarly, we could index before the concatenation:
In [12]: pd.concat([df1, df4.reindex(df1.index)], axis=1)
Out[12]:
A B C D B D F
0 A0 B0 C0 D0 NaN NaN NaN
1 A1 B1 C1 D1 NaN NaN NaN
2 A2 B2 C2 D2 B2 D2 F2
3 A3 B3 C3 D3 B3 D3 F3
Ignoring indexes on the concatenation axis#
For DataFrame objects which don’t have a meaningful index, you may wish
to append them and ignore the fact that they may have overlapping indexes. To
do this, use the ignore_index argument:
In [13]: result = pd.concat([df1, df4], ignore_index=True, sort=False)
Concatenating with mixed ndims#
You can concatenate a mix of Series and DataFrame objects. The
Series will be transformed to DataFrame with the column name as
the name of the Series.
In [14]: s1 = pd.Series(["X0", "X1", "X2", "X3"], name="X")
In [15]: result = pd.concat([df1, s1], axis=1)
Note
Since we’re concatenating a Series to a DataFrame, we could have
achieved the same result with DataFrame.assign(). To concatenate an
arbitrary number of pandas objects (DataFrame or Series), use
concat.
If unnamed Series are passed they will be numbered consecutively.
In [16]: s2 = pd.Series(["_0", "_1", "_2", "_3"])
In [17]: result = pd.concat([df1, s2, s2, s2], axis=1)
Passing ignore_index=True will drop all name references.
In [18]: result = pd.concat([df1, s1], axis=1, ignore_index=True)
More concatenating with group keys#
A fairly common use of the keys argument is to override the column names
when creating a new DataFrame based on existing Series.
Notice how the default behaviour consists on letting the resulting DataFrame
inherit the parent Series’ name, when these existed.
In [19]: s3 = pd.Series([0, 1, 2, 3], name="foo")
In [20]: s4 = pd.Series([0, 1, 2, 3])
In [21]: s5 = pd.Series([0, 1, 4, 5])
In [22]: pd.concat([s3, s4, s5], axis=1)
Out[22]:
foo 0 1
0 0 0 0
1 1 1 1
2 2 2 4
3 3 3 5
Through the keys argument we can override the existing column names.
In [23]: pd.concat([s3, s4, s5], axis=1, keys=["red", "blue", "yellow"])
Out[23]:
red blue yellow
0 0 0 0
1 1 1 1
2 2 2 4
3 3 3 5
Let’s consider a variation of the very first example presented:
In [24]: result = pd.concat(frames, keys=["x", "y", "z"])
You can also pass a dict to concat in which case the dict keys will be used
for the keys argument (unless other keys are specified):
In [25]: pieces = {"x": df1, "y": df2, "z": df3}
In [26]: result = pd.concat(pieces)
In [27]: result = pd.concat(pieces, keys=["z", "y"])
The MultiIndex created has levels that are constructed from the passed keys and
the index of the DataFrame pieces:
In [28]: result.index.levels
Out[28]: FrozenList([['z', 'y'], [4, 5, 6, 7, 8, 9, 10, 11]])
If you wish to specify other levels (as will occasionally be the case), you can
do so using the levels argument:
In [29]: result = pd.concat(
....: pieces, keys=["x", "y", "z"], levels=[["z", "y", "x", "w"]], names=["group_key"]
....: )
....:
In [30]: result.index.levels
Out[30]: FrozenList([['z', 'y', 'x', 'w'], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])
This is fairly esoteric, but it is actually necessary for implementing things
like GroupBy where the order of a categorical variable is meaningful.
Appending rows to a DataFrame#
If you have a series that you want to append as a single row to a DataFrame, you can convert the row into a
DataFrame and use concat
In [31]: s2 = pd.Series(["X0", "X1", "X2", "X3"], index=["A", "B", "C", "D"])
In [32]: result = pd.concat([df1, s2.to_frame().T], ignore_index=True)
You should use ignore_index with this method to instruct DataFrame to
discard its index. If you wish to preserve the index, you should construct an
appropriately-indexed DataFrame and append or concatenate those objects.
Database-style DataFrame or named Series joining/merging#
pandas has full-featured, high performance in-memory join operations
idiomatically very similar to relational databases like SQL. These methods
perform significantly better (in some cases well over an order of magnitude
better) than other open source implementations (like base::merge.data.frame
in R). The reason for this is careful algorithmic design and the internal layout
of the data in DataFrame.
See the cookbook for some advanced strategies.
Users who are familiar with SQL but new to pandas might be interested in a
comparison with SQL.
pandas provides a single function, merge(), as the entry point for
all standard database join operations between DataFrame or named Series objects:
pd.merge(
left,
right,
how="inner",
on=None,
left_on=None,
right_on=None,
left_index=False,
right_index=False,
sort=True,
suffixes=("_x", "_y"),
copy=True,
indicator=False,
validate=None,
)
left: A DataFrame or named Series object.
right: Another DataFrame or named Series object.
on: Column or index level names to join on. Must be found in both the left
and right DataFrame and/or Series objects. If not passed and left_index and
right_index are False, the intersection of the columns in the
DataFrames and/or Series will be inferred to be the join keys.
left_on: Columns or index levels from the left DataFrame or Series to use as
keys. Can either be column names, index level names, or arrays with length
equal to the length of the DataFrame or Series.
right_on: Columns or index levels from the right DataFrame or Series to use as
keys. Can either be column names, index level names, or arrays with length
equal to the length of the DataFrame or Series.
left_index: If True, use the index (row labels) from the left
DataFrame or Series as its join key(s). In the case of a DataFrame or Series with a MultiIndex
(hierarchical), the number of levels must match the number of join keys
from the right DataFrame or Series.
right_index: Same usage as left_index for the right DataFrame or Series
how: One of 'left', 'right', 'outer', 'inner', 'cross'. Defaults
to inner. See below for more detailed description of each method.
sort: Sort the result DataFrame by the join keys in lexicographical
order. Defaults to True, setting to False will improve performance
substantially in many cases.
suffixes: A tuple of string suffixes to apply to overlapping
columns. Defaults to ('_x', '_y').
copy: Always copy data (default True) from the passed DataFrame or named Series
objects, even when reindexing is not necessary. Cannot be avoided in many
cases but may improve performance / memory usage. The cases where copying
can be avoided are somewhat pathological but this option is provided
nonetheless.
indicator: Add a column to the output DataFrame called _merge
with information on the source of each row. _merge is Categorical-type
and takes on a value of left_only for observations whose merge key
only appears in 'left' DataFrame or Series, right_only for observations whose
merge key only appears in 'right' DataFrame or Series, and both if the
observation’s merge key is found in both.
validate : string, default None.
If specified, checks if merge is of specified type.
“one_to_one” or “1:1”: checks if merge keys are unique in both
left and right datasets.
“one_to_many” or “1:m”: checks if merge keys are unique in left
dataset.
“many_to_one” or “m:1”: checks if merge keys are unique in right
dataset.
“many_to_many” or “m:m”: allowed, but does not result in checks.
Note
Support for specifying index levels as the on, left_on, and
right_on parameters was added in version 0.23.0.
Support for merging named Series objects was added in version 0.24.0.
The return type will be the same as left. If left is a DataFrame or named Series
and right is a subclass of DataFrame, the return type will still be DataFrame.
merge is a function in the pandas namespace, and it is also available as a
DataFrame instance method merge(), with the calling
DataFrame being implicitly considered the left object in the join.
The related join() method, uses merge internally for the
index-on-index (by default) and column(s)-on-index join. If you are joining on
index only, you may wish to use DataFrame.join to save yourself some typing.
Brief primer on merge methods (relational algebra)#
Experienced users of relational databases like SQL will be familiar with the
terminology used to describe join operations between two SQL-table like
structures (DataFrame objects). There are several cases to consider which
are very important to understand:
one-to-one joins: for example when joining two DataFrame objects on
their indexes (which must contain unique values).
many-to-one joins: for example when joining an index (unique) to one or
more columns in a different DataFrame.
many-to-many joins: joining columns on columns.
Note
When joining columns on columns (potentially a many-to-many join), any
indexes on the passed DataFrame objects will be discarded.
It is worth spending some time understanding the result of the many-to-many
join case. In SQL / standard relational algebra, if a key combination appears
more than once in both tables, the resulting table will have the Cartesian
product of the associated data. Here is a very basic example with one unique
key combination:
In [33]: left = pd.DataFrame(
....: {
....: "key": ["K0", "K1", "K2", "K3"],
....: "A": ["A0", "A1", "A2", "A3"],
....: "B": ["B0", "B1", "B2", "B3"],
....: }
....: )
....:
In [34]: right = pd.DataFrame(
....: {
....: "key": ["K0", "K1", "K2", "K3"],
....: "C": ["C0", "C1", "C2", "C3"],
....: "D": ["D0", "D1", "D2", "D3"],
....: }
....: )
....:
In [35]: result = pd.merge(left, right, on="key")
Here is a more complicated example with multiple join keys. Only the keys
appearing in left and right are present (the intersection), since
how='inner' by default.
In [36]: left = pd.DataFrame(
....: {
....: "key1": ["K0", "K0", "K1", "K2"],
....: "key2": ["K0", "K1", "K0", "K1"],
....: "A": ["A0", "A1", "A2", "A3"],
....: "B": ["B0", "B1", "B2", "B3"],
....: }
....: )
....:
In [37]: right = pd.DataFrame(
....: {
....: "key1": ["K0", "K1", "K1", "K2"],
....: "key2": ["K0", "K0", "K0", "K0"],
....: "C": ["C0", "C1", "C2", "C3"],
....: "D": ["D0", "D1", "D2", "D3"],
....: }
....: )
....:
In [38]: result = pd.merge(left, right, on=["key1", "key2"])
The how argument to merge specifies how to determine which keys are to
be included in the resulting table. If a key combination does not appear in
either the left or right tables, the values in the joined table will be
NA. Here is a summary of the how options and their SQL equivalent names:
Merge method
SQL Join Name
Description
left
LEFT OUTER JOIN
Use keys from left frame only
right
RIGHT OUTER JOIN
Use keys from right frame only
outer
FULL OUTER JOIN
Use union of keys from both frames
inner
INNER JOIN
Use intersection of keys from both frames
cross
CROSS JOIN
Create the cartesian product of rows of both frames
In [39]: result = pd.merge(left, right, how="left", on=["key1", "key2"])
In [40]: result = pd.merge(left, right, how="right", on=["key1", "key2"])
In [41]: result = pd.merge(left, right, how="outer", on=["key1", "key2"])
In [42]: result = pd.merge(left, right, how="inner", on=["key1", "key2"])
In [43]: result = pd.merge(left, right, how="cross")
You can merge a mult-indexed Series and a DataFrame, if the names of
the MultiIndex correspond to the columns from the DataFrame. Transform
the Series to a DataFrame using Series.reset_index() before merging,
as shown in the following example.
In [44]: df = pd.DataFrame({"Let": ["A", "B", "C"], "Num": [1, 2, 3]})
In [45]: df
Out[45]:
Let Num
0 A 1
1 B 2
2 C 3
In [46]: ser = pd.Series(
....: ["a", "b", "c", "d", "e", "f"],
....: index=pd.MultiIndex.from_arrays(
....: [["A", "B", "C"] * 2, [1, 2, 3, 4, 5, 6]], names=["Let", "Num"]
....: ),
....: )
....:
In [47]: ser
Out[47]:
Let Num
A 1 a
B 2 b
C 3 c
A 4 d
B 5 e
C 6 f
dtype: object
In [48]: pd.merge(df, ser.reset_index(), on=["Let", "Num"])
Out[48]:
Let Num 0
0 A 1 a
1 B 2 b
2 C 3 c
Here is another example with duplicate join keys in DataFrames:
In [49]: left = pd.DataFrame({"A": [1, 2], "B": [2, 2]})
In [50]: right = pd.DataFrame({"A": [4, 5, 6], "B": [2, 2, 2]})
In [51]: result = pd.merge(left, right, on="B", how="outer")
Warning
Joining / merging on duplicate keys can cause a returned frame that is the multiplication of the row dimensions, which may result in memory overflow. It is the user’ s responsibility to manage duplicate values in keys before joining large DataFrames.
Checking for duplicate keys#
Users can use the validate argument to automatically check whether there
are unexpected duplicates in their merge keys. Key uniqueness is checked before
merge operations and so should protect against memory overflows. Checking key
uniqueness is also a good way to ensure user data structures are as expected.
In the following example, there are duplicate values of B in the right
DataFrame. As this is not a one-to-one merge – as specified in the
validate argument – an exception will be raised.
In [52]: left = pd.DataFrame({"A": [1, 2], "B": [1, 2]})
In [53]: right = pd.DataFrame({"A": [4, 5, 6], "B": [2, 2, 2]})
In [53]: result = pd.merge(left, right, on="B", how="outer", validate="one_to_one")
...
MergeError: Merge keys are not unique in right dataset; not a one-to-one merge
If the user is aware of the duplicates in the right DataFrame but wants to
ensure there are no duplicates in the left DataFrame, one can use the
validate='one_to_many' argument instead, which will not raise an exception.
In [54]: pd.merge(left, right, on="B", how="outer", validate="one_to_many")
Out[54]:
A_x B A_y
0 1 1 NaN
1 2 2 4.0
2 2 2 5.0
3 2 2 6.0
The merge indicator#
merge() accepts the argument indicator. If True, a
Categorical-type column called _merge will be added to the output object
that takes on values:
Observation Origin
_merge value
Merge key only in 'left' frame
left_only
Merge key only in 'right' frame
right_only
Merge key in both frames
both
In [55]: df1 = pd.DataFrame({"col1": [0, 1], "col_left": ["a", "b"]})
In [56]: df2 = pd.DataFrame({"col1": [1, 2, 2], "col_right": [2, 2, 2]})
In [57]: pd.merge(df1, df2, on="col1", how="outer", indicator=True)
Out[57]:
col1 col_left col_right _merge
0 0 a NaN left_only
1 1 b 2.0 both
2 2 NaN 2.0 right_only
3 2 NaN 2.0 right_only
The indicator argument will also accept string arguments, in which case the indicator function will use the value of the passed string as the name for the indicator column.
In [58]: pd.merge(df1, df2, on="col1", how="outer", indicator="indicator_column")
Out[58]:
col1 col_left col_right indicator_column
0 0 a NaN left_only
1 1 b 2.0 both
2 2 NaN 2.0 right_only
3 2 NaN 2.0 right_only
Merge dtypes#
Merging will preserve the dtype of the join keys.
In [59]: left = pd.DataFrame({"key": [1], "v1": [10]})
In [60]: left
Out[60]:
key v1
0 1 10
In [61]: right = pd.DataFrame({"key": [1, 2], "v1": [20, 30]})
In [62]: right
Out[62]:
key v1
0 1 20
1 2 30
We are able to preserve the join keys:
In [63]: pd.merge(left, right, how="outer")
Out[63]:
key v1
0 1 10
1 1 20
2 2 30
In [64]: pd.merge(left, right, how="outer").dtypes
Out[64]:
key int64
v1 int64
dtype: object
Of course if you have missing values that are introduced, then the
resulting dtype will be upcast.
In [65]: pd.merge(left, right, how="outer", on="key")
Out[65]:
key v1_x v1_y
0 1 10.0 20
1 2 NaN 30
In [66]: pd.merge(left, right, how="outer", on="key").dtypes
Out[66]:
key int64
v1_x float64
v1_y int64
dtype: object
Merging will preserve category dtypes of the mergands. See also the section on categoricals.
The left frame.
In [67]: from pandas.api.types import CategoricalDtype
In [68]: X = pd.Series(np.random.choice(["foo", "bar"], size=(10,)))
In [69]: X = X.astype(CategoricalDtype(categories=["foo", "bar"]))
In [70]: left = pd.DataFrame(
....: {"X": X, "Y": np.random.choice(["one", "two", "three"], size=(10,))}
....: )
....:
In [71]: left
Out[71]:
X Y
0 bar one
1 foo one
2 foo three
3 bar three
4 foo one
5 bar one
6 bar three
7 bar three
8 bar three
9 foo three
In [72]: left.dtypes
Out[72]:
X category
Y object
dtype: object
The right frame.
In [73]: right = pd.DataFrame(
....: {
....: "X": pd.Series(["foo", "bar"], dtype=CategoricalDtype(["foo", "bar"])),
....: "Z": [1, 2],
....: }
....: )
....:
In [74]: right
Out[74]:
X Z
0 foo 1
1 bar 2
In [75]: right.dtypes
Out[75]:
X category
Z int64
dtype: object
The merged result:
In [76]: result = pd.merge(left, right, how="outer")
In [77]: result
Out[77]:
X Y Z
0 bar one 2
1 bar three 2
2 bar one 2
3 bar three 2
4 bar three 2
5 bar three 2
6 foo one 1
7 foo three 1
8 foo one 1
9 foo three 1
In [78]: result.dtypes
Out[78]:
X category
Y object
Z int64
dtype: object
Note
The category dtypes must be exactly the same, meaning the same categories and the ordered attribute.
Otherwise the result will coerce to the categories’ dtype.
Note
Merging on category dtypes that are the same can be quite performant compared to object dtype merging.
Joining on index#
DataFrame.join() is a convenient method for combining the columns of two
potentially differently-indexed DataFrames into a single result
DataFrame. Here is a very basic example:
In [79]: left = pd.DataFrame(
....: {"A": ["A0", "A1", "A2"], "B": ["B0", "B1", "B2"]}, index=["K0", "K1", "K2"]
....: )
....:
In [80]: right = pd.DataFrame(
....: {"C": ["C0", "C2", "C3"], "D": ["D0", "D2", "D3"]}, index=["K0", "K2", "K3"]
....: )
....:
In [81]: result = left.join(right)
In [82]: result = left.join(right, how="outer")
The same as above, but with how='inner'.
In [83]: result = left.join(right, how="inner")
The data alignment here is on the indexes (row labels). This same behavior can
be achieved using merge plus additional arguments instructing it to use the
indexes:
In [84]: result = pd.merge(left, right, left_index=True, right_index=True, how="outer")
In [85]: result = pd.merge(left, right, left_index=True, right_index=True, how="inner")
Joining key columns on an index#
join() takes an optional on argument which may be a column
or multiple column names, which specifies that the passed DataFrame is to be
aligned on that column in the DataFrame. These two function calls are
completely equivalent:
left.join(right, on=key_or_keys)
pd.merge(
left, right, left_on=key_or_keys, right_index=True, how="left", sort=False
)
Obviously you can choose whichever form you find more convenient. For
many-to-one joins (where one of the DataFrame’s is already indexed by the
join key), using join may be more convenient. Here is a simple example:
In [86]: left = pd.DataFrame(
....: {
....: "A": ["A0", "A1", "A2", "A3"],
....: "B": ["B0", "B1", "B2", "B3"],
....: "key": ["K0", "K1", "K0", "K1"],
....: }
....: )
....:
In [87]: right = pd.DataFrame({"C": ["C0", "C1"], "D": ["D0", "D1"]}, index=["K0", "K1"])
In [88]: result = left.join(right, on="key")
In [89]: result = pd.merge(
....: left, right, left_on="key", right_index=True, how="left", sort=False
....: )
....:
To join on multiple keys, the passed DataFrame must have a MultiIndex:
In [90]: left = pd.DataFrame(
....: {
....: "A": ["A0", "A1", "A2", "A3"],
....: "B": ["B0", "B1", "B2", "B3"],
....: "key1": ["K0", "K0", "K1", "K2"],
....: "key2": ["K0", "K1", "K0", "K1"],
....: }
....: )
....:
In [91]: index = pd.MultiIndex.from_tuples(
....: [("K0", "K0"), ("K1", "K0"), ("K2", "K0"), ("K2", "K1")]
....: )
....:
In [92]: right = pd.DataFrame(
....: {"C": ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"]}, index=index
....: )
....:
Now this can be joined by passing the two key column names:
In [93]: result = left.join(right, on=["key1", "key2"])
The default for DataFrame.join is to perform a left join (essentially a
“VLOOKUP” operation, for Excel users), which uses only the keys found in the
calling DataFrame. Other join types, for example inner join, can be just as
easily performed:
In [94]: result = left.join(right, on=["key1", "key2"], how="inner")
As you can see, this drops any rows where there was no match.
Joining a single Index to a MultiIndex#
You can join a singly-indexed DataFrame with a level of a MultiIndexed DataFrame.
The level will match on the name of the index of the singly-indexed frame against
a level name of the MultiIndexed frame.
In [95]: left = pd.DataFrame(
....: {"A": ["A0", "A1", "A2"], "B": ["B0", "B1", "B2"]},
....: index=pd.Index(["K0", "K1", "K2"], name="key"),
....: )
....:
In [96]: index = pd.MultiIndex.from_tuples(
....: [("K0", "Y0"), ("K1", "Y1"), ("K2", "Y2"), ("K2", "Y3")],
....: names=["key", "Y"],
....: )
....:
In [97]: right = pd.DataFrame(
....: {"C": ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"]},
....: index=index,
....: )
....:
In [98]: result = left.join(right, how="inner")
This is equivalent but less verbose and more memory efficient / faster than this.
In [99]: result = pd.merge(
....: left.reset_index(), right.reset_index(), on=["key"], how="inner"
....: ).set_index(["key","Y"])
....:
Joining with two MultiIndexes#
This is supported in a limited way, provided that the index for the right
argument is completely used in the join, and is a subset of the indices in
the left argument, as in this example:
In [100]: leftindex = pd.MultiIndex.from_product(
.....: [list("abc"), list("xy"), [1, 2]], names=["abc", "xy", "num"]
.....: )
.....:
In [101]: left = pd.DataFrame({"v1": range(12)}, index=leftindex)
In [102]: left
Out[102]:
v1
abc xy num
a x 1 0
2 1
y 1 2
2 3
b x 1 4
2 5
y 1 6
2 7
c x 1 8
2 9
y 1 10
2 11
In [103]: rightindex = pd.MultiIndex.from_product(
.....: [list("abc"), list("xy")], names=["abc", "xy"]
.....: )
.....:
In [104]: right = pd.DataFrame({"v2": [100 * i for i in range(1, 7)]}, index=rightindex)
In [105]: right
Out[105]:
v2
abc xy
a x 100
y 200
b x 300
y 400
c x 500
y 600
In [106]: left.join(right, on=["abc", "xy"], how="inner")
Out[106]:
v1 v2
abc xy num
a x 1 0 100
2 1 100
y 1 2 200
2 3 200
b x 1 4 300
2 5 300
y 1 6 400
2 7 400
c x 1 8 500
2 9 500
y 1 10 600
2 11 600
If that condition is not satisfied, a join with two multi-indexes can be
done using the following code.
In [107]: leftindex = pd.MultiIndex.from_tuples(
.....: [("K0", "X0"), ("K0", "X1"), ("K1", "X2")], names=["key", "X"]
.....: )
.....:
In [108]: left = pd.DataFrame(
.....: {"A": ["A0", "A1", "A2"], "B": ["B0", "B1", "B2"]}, index=leftindex
.....: )
.....:
In [109]: rightindex = pd.MultiIndex.from_tuples(
.....: [("K0", "Y0"), ("K1", "Y1"), ("K2", "Y2"), ("K2", "Y3")], names=["key", "Y"]
.....: )
.....:
In [110]: right = pd.DataFrame(
.....: {"C": ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"]}, index=rightindex
.....: )
.....:
In [111]: result = pd.merge(
.....: left.reset_index(), right.reset_index(), on=["key"], how="inner"
.....: ).set_index(["key", "X", "Y"])
.....:
Merging on a combination of columns and index levels#
Strings passed as the on, left_on, and right_on parameters
may refer to either column names or index level names. This enables merging
DataFrame instances on a combination of index levels and columns without
resetting indexes.
In [112]: left_index = pd.Index(["K0", "K0", "K1", "K2"], name="key1")
In [113]: left = pd.DataFrame(
.....: {
.....: "A": ["A0", "A1", "A2", "A3"],
.....: "B": ["B0", "B1", "B2", "B3"],
.....: "key2": ["K0", "K1", "K0", "K1"],
.....: },
.....: index=left_index,
.....: )
.....:
In [114]: right_index = pd.Index(["K0", "K1", "K2", "K2"], name="key1")
In [115]: right = pd.DataFrame(
.....: {
.....: "C": ["C0", "C1", "C2", "C3"],
.....: "D": ["D0", "D1", "D2", "D3"],
.....: "key2": ["K0", "K0", "K0", "K1"],
.....: },
.....: index=right_index,
.....: )
.....:
In [116]: result = left.merge(right, on=["key1", "key2"])
Note
When DataFrames are merged on a string that matches an index level in both
frames, the index level is preserved as an index level in the resulting
DataFrame.
Note
When DataFrames are merged using only some of the levels of a MultiIndex,
the extra levels will be dropped from the resulting merge. In order to
preserve those levels, use reset_index on those level names to move
those levels to columns prior to doing the merge.
Note
If a string matches both a column name and an index level name, then a
warning is issued and the column takes precedence. This will result in an
ambiguity error in a future version.
Overlapping value columns#
The merge suffixes argument takes a tuple of list of strings to append to
overlapping column names in the input DataFrames to disambiguate the result
columns:
In [117]: left = pd.DataFrame({"k": ["K0", "K1", "K2"], "v": [1, 2, 3]})
In [118]: right = pd.DataFrame({"k": ["K0", "K0", "K3"], "v": [4, 5, 6]})
In [119]: result = pd.merge(left, right, on="k")
In [120]: result = pd.merge(left, right, on="k", suffixes=("_l", "_r"))
DataFrame.join() has lsuffix and rsuffix arguments which behave
similarly.
In [121]: left = left.set_index("k")
In [122]: right = right.set_index("k")
In [123]: result = left.join(right, lsuffix="_l", rsuffix="_r")
Joining multiple DataFrames#
A list or tuple of DataFrames can also be passed to join()
to join them together on their indexes.
In [124]: right2 = pd.DataFrame({"v": [7, 8, 9]}, index=["K1", "K1", "K2"])
In [125]: result = left.join([right, right2])
Merging together values within Series or DataFrame columns#
Another fairly common situation is to have two like-indexed (or similarly
indexed) Series or DataFrame objects and wanting to “patch” values in
one object from values for matching indices in the other. Here is an example:
In [126]: df1 = pd.DataFrame(
.....: [[np.nan, 3.0, 5.0], [-4.6, np.nan, np.nan], [np.nan, 7.0, np.nan]]
.....: )
.....:
In [127]: df2 = pd.DataFrame([[-42.6, np.nan, -8.2], [-5.0, 1.6, 4]], index=[1, 2])
For this, use the combine_first() method:
In [128]: result = df1.combine_first(df2)
Note that this method only takes values from the right DataFrame if they are
missing in the left DataFrame. A related method, update(),
alters non-NA values in place:
In [129]: df1.update(df2)
Timeseries friendly merging#
Merging ordered data#
A merge_ordered() function allows combining time series and other
ordered data. In particular it has an optional fill_method keyword to
fill/interpolate missing data:
In [130]: left = pd.DataFrame(
.....: {"k": ["K0", "K1", "K1", "K2"], "lv": [1, 2, 3, 4], "s": ["a", "b", "c", "d"]}
.....: )
.....:
In [131]: right = pd.DataFrame({"k": ["K1", "K2", "K4"], "rv": [1, 2, 3]})
In [132]: pd.merge_ordered(left, right, fill_method="ffill", left_by="s")
Out[132]:
k lv s rv
0 K0 1.0 a NaN
1 K1 1.0 a 1.0
2 K2 1.0 a 2.0
3 K4 1.0 a 3.0
4 K1 2.0 b 1.0
5 K2 2.0 b 2.0
6 K4 2.0 b 3.0
7 K1 3.0 c 1.0
8 K2 3.0 c 2.0
9 K4 3.0 c 3.0
10 K1 NaN d 1.0
11 K2 4.0 d 2.0
12 K4 4.0 d 3.0
Merging asof#
A merge_asof() is similar to an ordered left-join except that we match on
nearest key rather than equal keys. For each row in the left DataFrame,
we select the last row in the right DataFrame whose on key is less
than the left’s key. Both DataFrames must be sorted by the key.
Optionally an asof merge can perform a group-wise merge. This matches the
by key equally, in addition to the nearest match on the on key.
For example; we might have trades and quotes and we want to asof
merge them.
In [133]: trades = pd.DataFrame(
.....: {
.....: "time": pd.to_datetime(
.....: [
.....: "20160525 13:30:00.023",
.....: "20160525 13:30:00.038",
.....: "20160525 13:30:00.048",
.....: "20160525 13:30:00.048",
.....: "20160525 13:30:00.048",
.....: ]
.....: ),
.....: "ticker": ["MSFT", "MSFT", "GOOG", "GOOG", "AAPL"],
.....: "price": [51.95, 51.95, 720.77, 720.92, 98.00],
.....: "quantity": [75, 155, 100, 100, 100],
.....: },
.....: columns=["time", "ticker", "price", "quantity"],
.....: )
.....:
In [134]: quotes = pd.DataFrame(
.....: {
.....: "time": pd.to_datetime(
.....: [
.....: "20160525 13:30:00.023",
.....: "20160525 13:30:00.023",
.....: "20160525 13:30:00.030",
.....: "20160525 13:30:00.041",
.....: "20160525 13:30:00.048",
.....: "20160525 13:30:00.049",
.....: "20160525 13:30:00.072",
.....: "20160525 13:30:00.075",
.....: ]
.....: ),
.....: "ticker": ["GOOG", "MSFT", "MSFT", "MSFT", "GOOG", "AAPL", "GOOG", "MSFT"],
.....: "bid": [720.50, 51.95, 51.97, 51.99, 720.50, 97.99, 720.50, 52.01],
.....: "ask": [720.93, 51.96, 51.98, 52.00, 720.93, 98.01, 720.88, 52.03],
.....: },
.....: columns=["time", "ticker", "bid", "ask"],
.....: )
.....:
In [135]: trades
Out[135]:
time ticker price quantity
0 2016-05-25 13:30:00.023 MSFT 51.95 75
1 2016-05-25 13:30:00.038 MSFT 51.95 155
2 2016-05-25 13:30:00.048 GOOG 720.77 100
3 2016-05-25 13:30:00.048 GOOG 720.92 100
4 2016-05-25 13:30:00.048 AAPL 98.00 100
In [136]: quotes
Out[136]:
time ticker bid ask
0 2016-05-25 13:30:00.023 GOOG 720.50 720.93
1 2016-05-25 13:30:00.023 MSFT 51.95 51.96
2 2016-05-25 13:30:00.030 MSFT 51.97 51.98
3 2016-05-25 13:30:00.041 MSFT 51.99 52.00
4 2016-05-25 13:30:00.048 GOOG 720.50 720.93
5 2016-05-25 13:30:00.049 AAPL 97.99 98.01
6 2016-05-25 13:30:00.072 GOOG 720.50 720.88
7 2016-05-25 13:30:00.075 MSFT 52.01 52.03
By default we are taking the asof of the quotes.
In [137]: pd.merge_asof(trades, quotes, on="time", by="ticker")
Out[137]:
time ticker price quantity bid ask
0 2016-05-25 13:30:00.023 MSFT 51.95 75 51.95 51.96
1 2016-05-25 13:30:00.038 MSFT 51.95 155 51.97 51.98
2 2016-05-25 13:30:00.048 GOOG 720.77 100 720.50 720.93
3 2016-05-25 13:30:00.048 GOOG 720.92 100 720.50 720.93
4 2016-05-25 13:30:00.048 AAPL 98.00 100 NaN NaN
We only asof within 2ms between the quote time and the trade time.
In [138]: pd.merge_asof(trades, quotes, on="time", by="ticker", tolerance=pd.Timedelta("2ms"))
Out[138]:
time ticker price quantity bid ask
0 2016-05-25 13:30:00.023 MSFT 51.95 75 51.95 51.96
1 2016-05-25 13:30:00.038 MSFT 51.95 155 NaN NaN
2 2016-05-25 13:30:00.048 GOOG 720.77 100 720.50 720.93
3 2016-05-25 13:30:00.048 GOOG 720.92 100 720.50 720.93
4 2016-05-25 13:30:00.048 AAPL 98.00 100 NaN NaN
We only asof within 10ms between the quote time and the trade time and we
exclude exact matches on time. Note that though we exclude the exact matches
(of the quotes), prior quotes do propagate to that point in time.
In [139]: pd.merge_asof(
.....: trades,
.....: quotes,
.....: on="time",
.....: by="ticker",
.....: tolerance=pd.Timedelta("10ms"),
.....: allow_exact_matches=False,
.....: )
.....:
Out[139]:
time ticker price quantity bid ask
0 2016-05-25 13:30:00.023 MSFT 51.95 75 NaN NaN
1 2016-05-25 13:30:00.038 MSFT 51.95 155 51.97 51.98
2 2016-05-25 13:30:00.048 GOOG 720.77 100 NaN NaN
3 2016-05-25 13:30:00.048 GOOG 720.92 100 NaN NaN
4 2016-05-25 13:30:00.048 AAPL 98.00 100 NaN NaN
Comparing objects#
The compare() and compare() methods allow you to
compare two DataFrame or Series, respectively, and summarize their differences.
This feature was added in V1.1.0.
For example, you might want to compare two DataFrame and stack their differences
side by side.
In [140]: df = pd.DataFrame(
.....: {
.....: "col1": ["a", "a", "b", "b", "a"],
.....: "col2": [1.0, 2.0, 3.0, np.nan, 5.0],
.....: "col3": [1.0, 2.0, 3.0, 4.0, 5.0],
.....: },
.....: columns=["col1", "col2", "col3"],
.....: )
.....:
In [141]: df
Out[141]:
col1 col2 col3
0 a 1.0 1.0
1 a 2.0 2.0
2 b 3.0 3.0
3 b NaN 4.0
4 a 5.0 5.0
In [142]: df2 = df.copy()
In [143]: df2.loc[0, "col1"] = "c"
In [144]: df2.loc[2, "col3"] = 4.0
In [145]: df2
Out[145]:
col1 col2 col3
0 c 1.0 1.0
1 a 2.0 2.0
2 b 3.0 4.0
3 b NaN 4.0
4 a 5.0 5.0
In [146]: df.compare(df2)
Out[146]:
col1 col3
self other self other
0 a c NaN NaN
2 NaN NaN 3.0 4.0
By default, if two corresponding values are equal, they will be shown as NaN.
Furthermore, if all values in an entire row / column, the row / column will be
omitted from the result. The remaining differences will be aligned on columns.
If you wish, you may choose to stack the differences on rows.
In [147]: df.compare(df2, align_axis=0)
Out[147]:
col1 col3
0 self a NaN
other c NaN
2 self NaN 3.0
other NaN 4.0
If you wish to keep all original rows and columns, set keep_shape argument
to True.
In [148]: df.compare(df2, keep_shape=True)
Out[148]:
col1 col2 col3
self other self other self other
0 a c NaN NaN NaN NaN
1 NaN NaN NaN NaN NaN NaN
2 NaN NaN NaN NaN 3.0 4.0
3 NaN NaN NaN NaN NaN NaN
4 NaN NaN NaN NaN NaN NaN
You may also keep all the original values even if they are equal.
In [149]: df.compare(df2, keep_shape=True, keep_equal=True)
Out[149]:
col1 col2 col3
self other self other self other
0 a c 1.0 1.0 1.0 1.0
1 a a 2.0 2.0 2.0 2.0
2 b b 3.0 3.0 3.0 4.0
3 b b NaN NaN 4.0 4.0
4 a a 5.0 5.0 5.0 5.0
|
user_guide/merging.html
|
pandas.Series.to_markdown
|
`pandas.Series.to_markdown`
Print Series in Markdown-friendly format.
```
>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
>>> print(s.to_markdown())
| | animal |
|---:|:---------|
| 0 | elk |
| 1 | pig |
| 2 | dog |
| 3 | quetzal |
```
|
Series.to_markdown(buf=None, mode='wt', index=True, storage_options=None, **kwargs)[source]#
Print Series in Markdown-friendly format.
New in version 1.0.0.
Parameters
bufstr, Path or StringIO-like, optional, default NoneBuffer to write to. If None, the output is returned as a string.
modestr, optionalMode in which file is opened, “wt” by default.
indexbool, optional, default TrueAdd index (row) labels.
New in version 1.1.0.
storage_optionsdict, optionalExtra options that make sense for a particular storage connection, e.g.
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
are forwarded to urllib.request.Request as header options. For other
URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are
forwarded to fsspec.open. Please see fsspec and urllib for more
details, and for more examples on storage options refer here.
New in version 1.2.0.
**kwargsThese parameters will be passed to tabulate.
Returns
strSeries in Markdown-friendly format.
Notes
Requires the tabulate package.
Examples
>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
>>> print(s.to_markdown())
| | animal |
|---:|:---------|
| 0 | elk |
| 1 | pig |
| 2 | dog |
| 3 | quetzal |
Output markdown with a tabulate option.
>>> print(s.to_markdown(tablefmt="grid"))
+----+----------+
| | animal |
+====+==========+
| 0 | elk |
+----+----------+
| 1 | pig |
+----+----------+
| 2 | dog |
+----+----------+
| 3 | quetzal |
+----+----------+
|
reference/api/pandas.Series.to_markdown.html
|
pandas.tseries.offsets.BusinessMonthEnd.is_anchored
|
`pandas.tseries.offsets.BusinessMonthEnd.is_anchored`
Return boolean whether the frequency is a unit frequency (n=1).
```
>>> pd.DateOffset().is_anchored()
True
>>> pd.DateOffset(2).is_anchored()
False
```
|
BusinessMonthEnd.is_anchored()#
Return boolean whether the frequency is a unit frequency (n=1).
Examples
>>> pd.DateOffset().is_anchored()
True
>>> pd.DateOffset(2).is_anchored()
False
|
reference/api/pandas.tseries.offsets.BusinessMonthEnd.is_anchored.html
|
API reference
|
API reference
|
This page gives an overview of all public pandas objects, functions and
methods. All classes and functions exposed in pandas.* namespace are public.
Some subpackages are public which include pandas.errors,
pandas.plotting, and pandas.testing. Public functions in
pandas.io and pandas.tseries submodules are mentioned in
the documentation. pandas.api.types subpackage holds some
public functions related to data types in pandas.
Warning
The pandas.core, pandas.compat, and pandas.util top-level modules are PRIVATE. Stable functionality in such modules is not guaranteed.
Input/output
Pickling
Flat file
Clipboard
Excel
JSON
HTML
XML
Latex
HDFStore: PyTables (HDF5)
Feather
Parquet
ORC
SAS
SPSS
SQL
Google BigQuery
STATA
General functions
Data manipulations
Top-level missing data
Top-level dealing with numeric data
Top-level dealing with datetimelike data
Top-level dealing with Interval data
Top-level evaluation
Hashing
Importing from other DataFrame libraries
Series
Constructor
Attributes
Conversion
Indexing, iteration
Binary operator functions
Function application, GroupBy & window
Computations / descriptive stats
Reindexing / selection / label manipulation
Missing data handling
Reshaping, sorting
Combining / comparing / joining / merging
Time Series-related
Accessors
Plotting
Serialization / IO / conversion
DataFrame
Constructor
Attributes and underlying data
Conversion
Indexing, iteration
Binary operator functions
Function application, GroupBy & window
Computations / descriptive stats
Reindexing / selection / label manipulation
Missing data handling
Reshaping, sorting, transposing
Combining / comparing / joining / merging
Time Series-related
Flags
Metadata
Plotting
Sparse accessor
Serialization / IO / conversion
pandas arrays, scalars, and data types
Objects
Utilities
Index objects
Index
Numeric Index
CategoricalIndex
IntervalIndex
MultiIndex
DatetimeIndex
TimedeltaIndex
PeriodIndex
Date offsets
DateOffset
BusinessDay
BusinessHour
CustomBusinessDay
CustomBusinessHour
MonthEnd
MonthBegin
BusinessMonthEnd
BusinessMonthBegin
CustomBusinessMonthEnd
CustomBusinessMonthBegin
SemiMonthEnd
SemiMonthBegin
Week
WeekOfMonth
LastWeekOfMonth
BQuarterEnd
BQuarterBegin
QuarterEnd
QuarterBegin
BYearEnd
BYearBegin
YearEnd
YearBegin
FY5253
FY5253Quarter
Easter
Tick
Day
Hour
Minute
Second
Milli
Micro
Nano
Frequencies
pandas.tseries.frequencies.to_offset
Window
Rolling window functions
Weighted window functions
Expanding window functions
Exponentially-weighted window functions
Window indexer
GroupBy
Indexing, iteration
Function application
Computations / descriptive stats
Resampling
Indexing, iteration
Function application
Upsampling
Computations / descriptive stats
Style
Styler constructor
Styler properties
Style application
Builtin styles
Style export and import
Plotting
pandas.plotting.andrews_curves
pandas.plotting.autocorrelation_plot
pandas.plotting.bootstrap_plot
pandas.plotting.boxplot
pandas.plotting.deregister_matplotlib_converters
pandas.plotting.lag_plot
pandas.plotting.parallel_coordinates
pandas.plotting.plot_params
pandas.plotting.radviz
pandas.plotting.register_matplotlib_converters
pandas.plotting.scatter_matrix
pandas.plotting.table
Options and settings
Working with options
Extensions
pandas.api.extensions.register_extension_dtype
pandas.api.extensions.register_dataframe_accessor
pandas.api.extensions.register_series_accessor
pandas.api.extensions.register_index_accessor
pandas.api.extensions.ExtensionDtype
pandas.api.extensions.ExtensionArray
pandas.arrays.PandasArray
pandas.api.indexers.check_array_indexer
Testing
Assertion functions
Exceptions and warnings
Bug report function
Test suite runner
|
reference/index.html
|
pandas.tseries.offsets.LastWeekOfMonth.is_month_end
|
`pandas.tseries.offsets.LastWeekOfMonth.is_month_end`
Return boolean whether a timestamp occurs on the month end.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_end(ts)
False
```
|
LastWeekOfMonth.is_month_end()#
Return boolean whether a timestamp occurs on the month end.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_end(ts)
False
|
reference/api/pandas.tseries.offsets.LastWeekOfMonth.is_month_end.html
|
pandas.Series.dt
|
`pandas.Series.dt`
Accessor object for datetimelike properties of the Series values.
Examples
```
>>> seconds_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="s"))
>>> seconds_series
0 2000-01-01 00:00:00
1 2000-01-01 00:00:01
2 2000-01-01 00:00:02
dtype: datetime64[ns]
>>> seconds_series.dt.second
0 0
1 1
2 2
dtype: int64
```
|
Series.dt()[source]#
Accessor object for datetimelike properties of the Series values.
Examples
>>> seconds_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="s"))
>>> seconds_series
0 2000-01-01 00:00:00
1 2000-01-01 00:00:01
2 2000-01-01 00:00:02
dtype: datetime64[ns]
>>> seconds_series.dt.second
0 0
1 1
2 2
dtype: int64
>>> hours_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="h"))
>>> hours_series
0 2000-01-01 00:00:00
1 2000-01-01 01:00:00
2 2000-01-01 02:00:00
dtype: datetime64[ns]
>>> hours_series.dt.hour
0 0
1 1
2 2
dtype: int64
>>> quarters_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="q"))
>>> quarters_series
0 2000-03-31
1 2000-06-30
2 2000-09-30
dtype: datetime64[ns]
>>> quarters_series.dt.quarter
0 1
1 2
2 3
dtype: int64
Returns a Series indexed like the original Series.
Raises TypeError if the Series does not contain datetimelike values.
|
reference/api/pandas.Series.dt.html
|
pandas.Series.to_list
|
`pandas.Series.to_list`
Return a list of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
|
Series.to_list()[source]#
Return a list of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
list
See also
numpy.ndarray.tolistReturn the array as an a.ndim-levels deep nested list of Python scalars.
|
reference/api/pandas.Series.to_list.html
|
pandas.Series.align
|
`pandas.Series.align`
Align two objects on their axes with the specified join method.
```
>>> df = pd.DataFrame(
... [[1, 2, 3, 4], [6, 7, 8, 9]], columns=["D", "B", "E", "A"], index=[1, 2]
... )
>>> other = pd.DataFrame(
... [[10, 20, 30, 40], [60, 70, 80, 90], [600, 700, 800, 900]],
... columns=["A", "B", "C", "D"],
... index=[2, 3, 4],
... )
>>> df
D B E A
1 1 2 3 4
2 6 7 8 9
>>> other
A B C D
2 10 20 30 40
3 60 70 80 90
4 600 700 800 900
```
|
Series.align(other, join='outer', axis=None, level=None, copy=True, fill_value=None, method=None, limit=None, fill_axis=0, broadcast_axis=None)[source]#
Align two objects on their axes with the specified join method.
Join method is specified for each axis Index.
Parameters
otherDataFrame or Series
join{‘outer’, ‘inner’, ‘left’, ‘right’}, default ‘outer’
axisallowed axis of the other object, default NoneAlign on index (0), columns (1), or both (None).
levelint or level name, default NoneBroadcast across a level, matching Index values on the
passed MultiIndex level.
copybool, default TrueAlways returns new objects. If copy=False and no reindexing is
required then original objects are returned.
fill_valuescalar, default np.NaNValue to use for missing values. Defaults to NaN, but can be any
“compatible” value.
method{‘backfill’, ‘bfill’, ‘pad’, ‘ffill’, None}, default NoneMethod to use for filling holes in reindexed Series:
pad / ffill: propagate last valid observation forward to next valid.
backfill / bfill: use NEXT valid observation to fill gap.
limitint, default NoneIf method is specified, this is the maximum number of consecutive
NaN values to forward/backward fill. In other words, if there is
a gap with more than this number of consecutive NaNs, it will only
be partially filled. If method is not specified, this is the
maximum number of entries along the entire axis where NaNs will be
filled. Must be greater than 0 if not None.
fill_axis{0 or ‘index’}, default 0Filling axis, method and limit.
broadcast_axis{0 or ‘index’}, default NoneBroadcast values along this axis, if aligning two objects of
different dimensions.
Returns
(left, right)(Series, type of other)Aligned objects.
Examples
>>> df = pd.DataFrame(
... [[1, 2, 3, 4], [6, 7, 8, 9]], columns=["D", "B", "E", "A"], index=[1, 2]
... )
>>> other = pd.DataFrame(
... [[10, 20, 30, 40], [60, 70, 80, 90], [600, 700, 800, 900]],
... columns=["A", "B", "C", "D"],
... index=[2, 3, 4],
... )
>>> df
D B E A
1 1 2 3 4
2 6 7 8 9
>>> other
A B C D
2 10 20 30 40
3 60 70 80 90
4 600 700 800 900
Align on columns:
>>> left, right = df.align(other, join="outer", axis=1)
>>> left
A B C D E
1 4 2 NaN 1 3
2 9 7 NaN 6 8
>>> right
A B C D E
2 10 20 30 40 NaN
3 60 70 80 90 NaN
4 600 700 800 900 NaN
We can also align on the index:
>>> left, right = df.align(other, join="outer", axis=0)
>>> left
D B E A
1 1.0 2.0 3.0 4.0
2 6.0 7.0 8.0 9.0
3 NaN NaN NaN NaN
4 NaN NaN NaN NaN
>>> right
A B C D
1 NaN NaN NaN NaN
2 10.0 20.0 30.0 40.0
3 60.0 70.0 80.0 90.0
4 600.0 700.0 800.0 900.0
Finally, the default axis=None will align on both index and columns:
>>> left, right = df.align(other, join="outer", axis=None)
>>> left
A B C D E
1 4.0 2.0 NaN 1.0 3.0
2 9.0 7.0 NaN 6.0 8.0
3 NaN NaN NaN NaN NaN
4 NaN NaN NaN NaN NaN
>>> right
A B C D E
1 NaN NaN NaN NaN NaN
2 10.0 20.0 30.0 40.0 NaN
3 60.0 70.0 80.0 90.0 NaN
4 600.0 700.0 800.0 900.0 NaN
|
reference/api/pandas.Series.align.html
|
pandas.DataFrame.boxplot
|
`pandas.DataFrame.boxplot`
Make a box plot from DataFrame columns.
Make a box-and-whisker plot from DataFrame columns, optionally grouped
by some other columns. A box plot is a method for graphically depicting
groups of numerical data through their quartiles.
The box extends from the Q1 to Q3 quartile values of the data,
with a line at the median (Q2). The whiskers extend from the edges
of box to show the range of the data. By default, they extend no more than
1.5 * IQR (IQR = Q3 - Q1) from the edges of the box, ending at the farthest
data point within that interval. Outliers are plotted as separate dots.
```
>>> np.random.seed(1234)
>>> df = pd.DataFrame(np.random.randn(10, 4),
... columns=['Col1', 'Col2', 'Col3', 'Col4'])
>>> boxplot = df.boxplot(column=['Col1', 'Col2', 'Col3'])
```
|
DataFrame.boxplot(column=None, by=None, ax=None, fontsize=None, rot=0, grid=True, figsize=None, layout=None, return_type=None, backend=None, **kwargs)[source]#
Make a box plot from DataFrame columns.
Make a box-and-whisker plot from DataFrame columns, optionally grouped
by some other columns. A box plot is a method for graphically depicting
groups of numerical data through their quartiles.
The box extends from the Q1 to Q3 quartile values of the data,
with a line at the median (Q2). The whiskers extend from the edges
of box to show the range of the data. By default, they extend no more than
1.5 * IQR (IQR = Q3 - Q1) from the edges of the box, ending at the farthest
data point within that interval. Outliers are plotted as separate dots.
For further details see
Wikipedia’s entry for boxplot.
Parameters
columnstr or list of str, optionalColumn name or list of names, or vector.
Can be any valid input to pandas.DataFrame.groupby().
bystr or array-like, optionalColumn in the DataFrame to pandas.DataFrame.groupby().
One box-plot will be done per value of columns in by.
axobject of class matplotlib.axes.Axes, optionalThe matplotlib axes to be used by boxplot.
fontsizefloat or strTick label font size in points or as a string (e.g., large).
rotint or float, default 0The rotation angle of labels (in degrees)
with respect to the screen coordinate system.
gridbool, default TrueSetting this to True will show the grid.
figsizeA tuple (width, height) in inchesThe size of the figure to create in matplotlib.
layouttuple (rows, columns), optionalFor example, (3, 5) will display the subplots
using 3 columns and 5 rows, starting from the top-left.
return_type{‘axes’, ‘dict’, ‘both’} or None, default ‘axes’The kind of object to return. The default is axes.
‘axes’ returns the matplotlib axes the boxplot is drawn on.
‘dict’ returns a dictionary whose values are the matplotlib
Lines of the boxplot.
‘both’ returns a namedtuple with the axes and dict.
when grouping with by, a Series mapping columns to
return_type is returned.
If return_type is None, a NumPy array
of axes with the same shape as layout is returned.
backendstr, default NoneBackend to use instead of the backend specified in the option
plotting.backend. For instance, ‘matplotlib’. Alternatively, to
specify the plotting.backend for the whole session, set
pd.options.plotting.backend.
New in version 1.0.0.
**kwargsAll other plotting keyword arguments to be passed to
matplotlib.pyplot.boxplot().
Returns
resultSee Notes.
See also
Series.plot.histMake a histogram.
matplotlib.pyplot.boxplotMatplotlib equivalent plot.
Notes
The return type depends on the return_type parameter:
‘axes’ : object of class matplotlib.axes.Axes
‘dict’ : dict of matplotlib.lines.Line2D objects
‘both’ : a namedtuple with structure (ax, lines)
For data grouped with by, return a Series of the above or a numpy
array:
Series
array (for return_type = None)
Use return_type='dict' when you want to tweak the appearance
of the lines after plotting. In this case a dict containing the Lines
making up the boxes, caps, fliers, medians, and whiskers is returned.
Examples
Boxplots can be created for every column in the dataframe
by df.boxplot() or indicating the columns to be used:
>>> np.random.seed(1234)
>>> df = pd.DataFrame(np.random.randn(10, 4),
... columns=['Col1', 'Col2', 'Col3', 'Col4'])
>>> boxplot = df.boxplot(column=['Col1', 'Col2', 'Col3'])
Boxplots of variables distributions grouped by the values of a third
variable can be created using the option by. For instance:
>>> df = pd.DataFrame(np.random.randn(10, 2),
... columns=['Col1', 'Col2'])
>>> df['X'] = pd.Series(['A', 'A', 'A', 'A', 'A',
... 'B', 'B', 'B', 'B', 'B'])
>>> boxplot = df.boxplot(by='X')
A list of strings (i.e. ['X', 'Y']) can be passed to boxplot
in order to group the data by combination of the variables in the x-axis:
>>> df = pd.DataFrame(np.random.randn(10, 3),
... columns=['Col1', 'Col2', 'Col3'])
>>> df['X'] = pd.Series(['A', 'A', 'A', 'A', 'A',
... 'B', 'B', 'B', 'B', 'B'])
>>> df['Y'] = pd.Series(['A', 'B', 'A', 'B', 'A',
... 'B', 'A', 'B', 'A', 'B'])
>>> boxplot = df.boxplot(column=['Col1', 'Col2'], by=['X', 'Y'])
The layout of boxplot can be adjusted giving a tuple to layout:
>>> boxplot = df.boxplot(column=['Col1', 'Col2'], by='X',
... layout=(2, 1))
Additional formatting can be done to the boxplot, like suppressing the grid
(grid=False), rotating the labels in the x-axis (i.e. rot=45)
or changing the fontsize (i.e. fontsize=15):
>>> boxplot = df.boxplot(grid=False, rot=45, fontsize=15)
The parameter return_type can be used to select the type of element
returned by boxplot. When return_type='axes' is selected,
the matplotlib axes on which the boxplot is drawn are returned:
>>> boxplot = df.boxplot(column=['Col1', 'Col2'], return_type='axes')
>>> type(boxplot)
<class 'matplotlib.axes._subplots.AxesSubplot'>
When grouping with by, a Series mapping columns to return_type
is returned:
>>> boxplot = df.boxplot(column=['Col1', 'Col2'], by='X',
... return_type='axes')
>>> type(boxplot)
<class 'pandas.core.series.Series'>
If return_type is None, a NumPy array of axes with the same shape
as layout is returned:
>>> boxplot = df.boxplot(column=['Col1', 'Col2'], by='X',
... return_type=None)
>>> type(boxplot)
<class 'numpy.ndarray'>
|
reference/api/pandas.DataFrame.boxplot.html
|
pandas.tseries.offsets.Week.is_on_offset
|
`pandas.tseries.offsets.Week.is_on_offset`
Return boolean whether a timestamp intersects with this frequency.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Day(1)
>>> freq.is_on_offset(ts)
True
```
|
Week.is_on_offset()#
Return boolean whether a timestamp intersects with this frequency.
Parameters
dtdatetime.datetimeTimestamp to check intersections with frequency.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Day(1)
>>> freq.is_on_offset(ts)
True
>>> ts = pd.Timestamp(2022, 8, 6)
>>> ts.day_name()
'Saturday'
>>> freq = pd.offsets.BusinessDay(1)
>>> freq.is_on_offset(ts)
False
|
reference/api/pandas.tseries.offsets.Week.is_on_offset.html
|
Contributing to the documentation
|
Contributing to the documentation
Contributing to the documentation benefits everyone who uses pandas.
We encourage you to help us improve the documentation, and
you don’t have to be an expert on pandas to do so! In fact,
there are sections of the docs that are worse off after being written by
experts. If something in the docs doesn’t make sense to you, updating the
relevant section after you figure it out is a great way to ensure it will help
the next person. Please visit the issues page
for a full list of issues that are currently open regarding the
Pandas documentation.
Documentation:
About the pandas documentation
Updating a pandas docstring
How to build the pandas documentation
|
Contributing to the documentation benefits everyone who uses pandas.
We encourage you to help us improve the documentation, and
you don’t have to be an expert on pandas to do so! In fact,
there are sections of the docs that are worse off after being written by
experts. If something in the docs doesn’t make sense to you, updating the
relevant section after you figure it out is a great way to ensure it will help
the next person. Please visit the issues page
for a full list of issues that are currently open regarding the
Pandas documentation.
Documentation:
About the pandas documentation
Updating a pandas docstring
How to build the pandas documentation
Requirements
Building the documentation
Building main branch documentation
Previewing changes
About the pandas documentation#
The documentation is written in reStructuredText, which is almost like writing
in plain English, and built using Sphinx. The
Sphinx Documentation has an excellent introduction to reST. Review the Sphinx docs to perform more
complex changes to the documentation as well.
Some other important things to know about the docs:
The pandas documentation consists of two parts: the docstrings in the code
itself and the docs in this folder doc/.
The docstrings provide a clear explanation of the usage of the individual
functions, while the documentation in this folder consists of tutorial-like
overviews per topic together with some other information (what’s new,
installation, etc).
The docstrings follow a pandas convention, based on the Numpy Docstring
Standard. Follow the pandas docstring guide for detailed
instructions on how to write a correct docstring.
pandas docstring guide
About docstrings and standards
Writing a docstring
Sharing docstrings
The tutorials make heavy use of the IPython directive sphinx extension.
This directive lets you put code in the documentation which will be run
during the doc build. For example:
.. ipython:: python
x = 2
x**3
will be rendered as:
In [1]: x = 2
In [2]: x**3
Out[2]: 8
Almost all code examples in the docs are run (and the output saved) during the
doc build. This approach means that code examples will always be up to date,
but it does make the doc building a bit more complex.
Our API documentation files in doc/source/reference house the auto-generated
documentation from the docstrings. For classes, there are a few subtleties
around controlling which methods and attributes have pages auto-generated.
We have two autosummary templates for classes.
_templates/autosummary/class.rst. Use this when you want to
automatically generate a page for every public method and attribute on the
class. The Attributes and Methods sections will be automatically
added to the class’ rendered documentation by numpydoc. See DataFrame
for an example.
_templates/autosummary/class_without_autosummary. Use this when you
want to pick a subset of methods / attributes to auto-generate pages for.
When using this template, you should include an Attributes and
Methods section in the class docstring. See CategoricalIndex for an
example.
Every method should be included in a toctree in one of the documentation files in
doc/source/reference, else Sphinx
will emit a warning.
The utility script scripts/validate_docstrings.py can be used to get a csv
summary of the API documentation. And also validate common errors in the docstring
of a specific class, function or method. The summary also compares the list of
methods documented in the files in doc/source/reference (which is used to generate
the API Reference page)
and the actual public methods.
This will identify methods documented in doc/source/reference that are not actually
class methods, and existing methods that are not documented in doc/source/reference.
Updating a pandas docstring#
When improving a single function or method’s docstring, it is not necessarily
needed to build the full documentation (see next section).
However, there is a script that checks a docstring (for example for the DataFrame.mean method):
python scripts/validate_docstrings.py pandas.DataFrame.mean
This script will indicate some formatting errors if present, and will also
run and test the examples included in the docstring.
Check the pandas docstring guide for a detailed guide
on how to format the docstring.
The examples in the docstring (‘doctests’) must be valid Python code,
that in a deterministic way returns the presented output, and that can be
copied and run by users. This can be checked with the script above, and is
also tested on Travis. A failing doctest will be a blocker for merging a PR.
Check the examples section in the docstring guide
for some tips and tricks to get the doctests passing.
When doing a PR with a docstring update, it is good to post the
output of the validation script in a comment on github.
How to build the pandas documentation#
Requirements#
First, you need to have a development environment to be able to build pandas
(see the docs on creating a development environment).
Building the documentation#
So how do you build the docs? Navigate to your local
doc/ directory in the console and run:
python make.py html
Then you can find the HTML output in the folder doc/build/html/.
The first time you build the docs, it will take quite a while because it has to run
all the code examples and build all the generated docstring pages. In subsequent
evocations, sphinx will try to only build the pages that have been modified.
If you want to do a full clean build, do:
python make.py clean
python make.py html
You can tell make.py to compile only a single section of the docs, greatly
reducing the turn-around time for checking your changes.
# omit autosummary and API section
python make.py clean
python make.py --no-api
# compile the docs with only a single section, relative to the "source" folder.
# For example, compiling only this guide (doc/source/development/contributing.rst)
python make.py clean
python make.py --single development/contributing.rst
# compile the reference docs for a single function
python make.py clean
python make.py --single pandas.DataFrame.join
# compile whatsnew and API section (to resolve links in the whatsnew)
python make.py clean
python make.py --whatsnew
For comparison, a full documentation build may take 15 minutes, but a single
section may take 15 seconds. Subsequent builds, which only process portions
you have changed, will be faster.
The build will automatically use the number of cores available on your machine
to speed up the documentation build. You can override this:
python make.py html --num-jobs 4
Open the following file in a web browser to see the full documentation you
just built:
doc/build/html/index.html
And you’ll have the satisfaction of seeing your new and improved documentation!
Building main branch documentation#
When pull requests are merged into the pandas main branch, the main parts of
the documentation are also built by Travis-CI. These docs are then hosted here, see also
the Continuous Integration section.
Previewing changes#
Once, the pull request is submitted, GitHub Actions will automatically build the
documentation. To view the built site:
Wait for the CI / Web and docs check to complete.
Click Details next to it.
From the Artifacts drop-down, click docs or website to download
the site as a ZIP file.
|
development/contributing_documentation.html
|
pandas.tseries.offsets.SemiMonthBegin.copy
|
`pandas.tseries.offsets.SemiMonthBegin.copy`
Return a copy of the frequency.
```
>>> freq = pd.DateOffset(1)
>>> freq_copy = freq.copy()
>>> freq is freq_copy
False
```
|
SemiMonthBegin.copy()#
Return a copy of the frequency.
Examples
>>> freq = pd.DateOffset(1)
>>> freq_copy = freq.copy()
>>> freq is freq_copy
False
|
reference/api/pandas.tseries.offsets.SemiMonthBegin.copy.html
|
pandas.tseries.offsets.FY5253.apply_index
|
`pandas.tseries.offsets.FY5253.apply_index`
Vectorized apply of DateOffset to DatetimeIndex.
|
FY5253.apply_index()#
Vectorized apply of DateOffset to DatetimeIndex.
Deprecated since version 1.1.0: Use offset + dtindex instead.
Parameters
indexDatetimeIndex
Returns
DatetimeIndex
Raises
NotImplementedErrorWhen the specific offset subclass does not have a vectorized
implementation.
|
reference/api/pandas.tseries.offsets.FY5253.apply_index.html
|
pandas.DataFrame.to_records
|
`pandas.DataFrame.to_records`
Convert DataFrame to a NumPy record array.
Index will be included as the first field of the record array if
requested.
```
>>> df = pd.DataFrame({'A': [1, 2], 'B': [0.5, 0.75]},
... index=['a', 'b'])
>>> df
A B
a 1 0.50
b 2 0.75
>>> df.to_records()
rec.array([('a', 1, 0.5 ), ('b', 2, 0.75)],
dtype=[('index', 'O'), ('A', '<i8'), ('B', '<f8')])
```
|
DataFrame.to_records(index=True, column_dtypes=None, index_dtypes=None)[source]#
Convert DataFrame to a NumPy record array.
Index will be included as the first field of the record array if
requested.
Parameters
indexbool, default TrueInclude index in resulting record array, stored in ‘index’
field or using the index label, if set.
column_dtypesstr, type, dict, default NoneIf a string or type, the data type to store all columns. If
a dictionary, a mapping of column names and indices (zero-indexed)
to specific data types.
index_dtypesstr, type, dict, default NoneIf a string or type, the data type to store all index levels. If
a dictionary, a mapping of index level names and indices
(zero-indexed) to specific data types.
This mapping is applied only if index=True.
Returns
numpy.recarrayNumPy ndarray with the DataFrame labels as fields and each row
of the DataFrame as entries.
See also
DataFrame.from_recordsConvert structured or record ndarray to DataFrame.
numpy.recarrayAn ndarray that allows field access using attributes, analogous to typed columns in a spreadsheet.
Examples
>>> df = pd.DataFrame({'A': [1, 2], 'B': [0.5, 0.75]},
... index=['a', 'b'])
>>> df
A B
a 1 0.50
b 2 0.75
>>> df.to_records()
rec.array([('a', 1, 0.5 ), ('b', 2, 0.75)],
dtype=[('index', 'O'), ('A', '<i8'), ('B', '<f8')])
If the DataFrame index has no label then the recarray field name
is set to ‘index’. If the index has a label then this is used as the
field name:
>>> df.index = df.index.rename("I")
>>> df.to_records()
rec.array([('a', 1, 0.5 ), ('b', 2, 0.75)],
dtype=[('I', 'O'), ('A', '<i8'), ('B', '<f8')])
The index can be excluded from the record array:
>>> df.to_records(index=False)
rec.array([(1, 0.5 ), (2, 0.75)],
dtype=[('A', '<i8'), ('B', '<f8')])
Data types can be specified for the columns:
>>> df.to_records(column_dtypes={"A": "int32"})
rec.array([('a', 1, 0.5 ), ('b', 2, 0.75)],
dtype=[('I', 'O'), ('A', '<i4'), ('B', '<f8')])
As well as for the index:
>>> df.to_records(index_dtypes="<S2")
rec.array([(b'a', 1, 0.5 ), (b'b', 2, 0.75)],
dtype=[('I', 'S2'), ('A', '<i8'), ('B', '<f8')])
>>> index_dtypes = f"<S{df.index.str.len().max()}"
>>> df.to_records(index_dtypes=index_dtypes)
rec.array([(b'a', 1, 0.5 ), (b'b', 2, 0.75)],
dtype=[('I', 'S1'), ('A', '<i8'), ('B', '<f8')])
|
reference/api/pandas.DataFrame.to_records.html
|
pandas.core.groupby.DataFrameGroupBy.all
|
`pandas.core.groupby.DataFrameGroupBy.all`
Return True if all values in the group are truthful, else False.
Flag to ignore nan values during truth testing.
|
DataFrameGroupBy.all(skipna=True)[source]#
Return True if all values in the group are truthful, else False.
Parameters
skipnabool, default TrueFlag to ignore nan values during truth testing.
Returns
Series or DataFrameDataFrame or Series of boolean values, where a value is True if all elements
are True within its respective group, False otherwise.
See also
Series.groupbyApply a function groupby to a Series.
DataFrame.groupbyApply a function groupby to each row or column of a DataFrame.
|
reference/api/pandas.core.groupby.DataFrameGroupBy.all.html
|
pandas.core.groupby.DataFrameGroupBy.any
|
`pandas.core.groupby.DataFrameGroupBy.any`
Return True if any value in the group is truthful, else False.
Flag to ignore nan values during truth testing.
|
DataFrameGroupBy.any(skipna=True)[source]#
Return True if any value in the group is truthful, else False.
Parameters
skipnabool, default TrueFlag to ignore nan values during truth testing.
Returns
Series or DataFrameDataFrame or Series of boolean values, where a value is True if any element
is True within its respective group, False otherwise.
See also
Series.groupbyApply a function groupby to a Series.
DataFrame.groupbyApply a function groupby to each row or column of a DataFrame.
|
reference/api/pandas.core.groupby.DataFrameGroupBy.any.html
|
pandas.Series.T
|
`pandas.Series.T`
Return the transpose, which is by definition self.
|
property Series.T[source]#
Return the transpose, which is by definition self.
|
reference/api/pandas.Series.T.html
|
pandas.api.types.is_named_tuple
|
`pandas.api.types.is_named_tuple`
Check if the object is a named tuple.
```
>>> from collections import namedtuple
>>> Point = namedtuple("Point", ["x", "y"])
>>> p = Point(1, 2)
>>>
>>> is_named_tuple(p)
True
>>> is_named_tuple((1, 2))
False
```
|
pandas.api.types.is_named_tuple(obj)[source]#
Check if the object is a named tuple.
Parameters
objThe object to check
Returns
is_named_tupleboolWhether obj is a named tuple.
Examples
>>> from collections import namedtuple
>>> Point = namedtuple("Point", ["x", "y"])
>>> p = Point(1, 2)
>>>
>>> is_named_tuple(p)
True
>>> is_named_tuple((1, 2))
False
|
reference/api/pandas.api.types.is_named_tuple.html
|
Resampling
|
Resampling
|
Resampler objects are returned by resample calls: pandas.DataFrame.resample(), pandas.Series.resample().
Indexing, iteration#
Resampler.__iter__()
Groupby iterator.
Resampler.groups
Dict {group name -> group labels}.
Resampler.indices
Dict {group name -> group indices}.
Resampler.get_group(name[, obj])
Construct DataFrame from group with provided name.
Function application#
Resampler.apply([func])
Aggregate using one or more operations over the specified axis.
Resampler.aggregate([func])
Aggregate using one or more operations over the specified axis.
Resampler.transform(arg, *args, **kwargs)
Call function producing a like-indexed Series on each group.
Resampler.pipe(func, *args, **kwargs)
Apply a func with arguments to this Resampler object and return its result.
Upsampling#
Resampler.ffill([limit])
Forward fill the values.
Resampler.backfill([limit])
(DEPRECATED) Backward fill the values.
Resampler.bfill([limit])
Backward fill the new missing values in the resampled data.
Resampler.pad([limit])
(DEPRECATED) Forward fill the values.
Resampler.nearest([limit])
Resample by using the nearest value.
Resampler.fillna(method[, limit])
Fill missing values introduced by upsampling.
Resampler.asfreq([fill_value])
Return the values at the new freq, essentially a reindex.
Resampler.interpolate([method, axis, limit, ...])
Interpolate values according to different methods.
Computations / descriptive stats#
Resampler.count()
Compute count of group, excluding missing values.
Resampler.nunique(*args, **kwargs)
Return number of unique elements in the group.
Resampler.first([numeric_only, min_count])
Compute the first non-null entry of each column.
Resampler.last([numeric_only, min_count])
Compute the last non-null entry of each column.
Resampler.max([numeric_only, min_count])
Compute max of group values.
Resampler.mean([numeric_only])
Compute mean of groups, excluding missing values.
Resampler.median([numeric_only])
Compute median of groups, excluding missing values.
Resampler.min([numeric_only, min_count])
Compute min of group values.
Resampler.ohlc(*args, **kwargs)
Compute open, high, low and close values of a group, excluding missing values.
Resampler.prod([numeric_only, min_count])
Compute prod of group values.
Resampler.size()
Compute group sizes.
Resampler.sem([ddof, numeric_only])
Compute standard error of the mean of groups, excluding missing values.
Resampler.std([ddof, numeric_only])
Compute standard deviation of groups, excluding missing values.
Resampler.sum([numeric_only, min_count])
Compute sum of group values.
Resampler.var([ddof, numeric_only])
Compute variance of groups, excluding missing values.
Resampler.quantile([q])
Return value at the given quantile.
|
reference/resampling.html
|
pandas.core.window.rolling.Rolling.min
|
`pandas.core.window.rolling.Rolling.min`
Calculate the rolling minimum.
```
>>> s = pd.Series([4, 3, 5, 2, 6])
>>> s.rolling(3).min()
0 NaN
1 NaN
2 3.0
3 2.0
4 2.0
dtype: float64
```
|
Rolling.min(numeric_only=False, *args, engine=None, engine_kwargs=None, **kwargs)[source]#
Calculate the rolling minimum.
Parameters
numeric_onlybool, default FalseInclude only float, int, boolean columns.
New in version 1.5.0.
*argsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
enginestr, default None
'cython' : Runs the operation through C-extensions from cython.
'numba' : Runs the operation through JIT compiled code from numba.
None : Defaults to 'cython' or globally setting compute.use_numba
New in version 1.3.0.
engine_kwargsdict, default None
For 'cython' engine, there are no accepted engine_kwargs
For 'numba' engine, the engine can accept nopython, nogil
and parallel dictionary keys. The values must either be True or
False. The default engine_kwargs for the 'numba' engine is
{'nopython': True, 'nogil': False, 'parallel': False}
New in version 1.3.0.
**kwargsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
Returns
Series or DataFrameReturn type is the same as the original object with np.float64 dtype.
See also
pandas.Series.rollingCalling rolling with Series data.
pandas.DataFrame.rollingCalling rolling with DataFrames.
pandas.Series.minAggregating min for Series.
pandas.DataFrame.minAggregating min for DataFrame.
Notes
See Numba engine and Numba (JIT compilation) for extended documentation and performance considerations for the Numba engine.
Examples
Performing a rolling minimum with a window size of 3.
>>> s = pd.Series([4, 3, 5, 2, 6])
>>> s.rolling(3).min()
0 NaN
1 NaN
2 3.0
3 2.0
4 2.0
dtype: float64
|
reference/api/pandas.core.window.rolling.Rolling.min.html
|
pandas.tseries.offsets.CustomBusinessMonthBegin.rollback
|
`pandas.tseries.offsets.CustomBusinessMonthBegin.rollback`
Roll provided date backward to next offset only if not on offset.
|
CustomBusinessMonthBegin.rollback()#
Roll provided date backward to next offset only if not on offset.
Returns
TimeStampRolled timestamp if not on offset, otherwise unchanged timestamp.
|
reference/api/pandas.tseries.offsets.CustomBusinessMonthBegin.rollback.html
|
pandas.Timestamp.is_quarter_end
|
`pandas.Timestamp.is_quarter_end`
Return True if date is last day of the quarter.
```
>>> ts = pd.Timestamp(2020, 3, 14)
>>> ts.is_quarter_end
False
```
|
Timestamp.is_quarter_end#
Return True if date is last day of the quarter.
Examples
>>> ts = pd.Timestamp(2020, 3, 14)
>>> ts.is_quarter_end
False
>>> ts = pd.Timestamp(2020, 3, 31)
>>> ts.is_quarter_end
True
|
reference/api/pandas.Timestamp.is_quarter_end.html
|
pandas.core.window.expanding.Expanding.max
|
`pandas.core.window.expanding.Expanding.max`
Calculate the expanding maximum.
|
Expanding.max(numeric_only=False, *args, engine=None, engine_kwargs=None, **kwargs)[source]#
Calculate the expanding maximum.
Parameters
numeric_onlybool, default FalseInclude only float, int, boolean columns.
New in version 1.5.0.
*argsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
enginestr, default None
'cython' : Runs the operation through C-extensions from cython.
'numba' : Runs the operation through JIT compiled code from numba.
None : Defaults to 'cython' or globally setting compute.use_numba
New in version 1.3.0.
engine_kwargsdict, default None
For 'cython' engine, there are no accepted engine_kwargs
For 'numba' engine, the engine can accept nopython, nogil
and parallel dictionary keys. The values must either be True or
False. The default engine_kwargs for the 'numba' engine is
{'nopython': True, 'nogil': False, 'parallel': False}
New in version 1.3.0.
**kwargsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
Returns
Series or DataFrameReturn type is the same as the original object with np.float64 dtype.
See also
pandas.Series.expandingCalling expanding with Series data.
pandas.DataFrame.expandingCalling expanding with DataFrames.
pandas.Series.maxAggregating max for Series.
pandas.DataFrame.maxAggregating max for DataFrame.
Notes
See Numba engine and Numba (JIT compilation) for extended documentation and performance considerations for the Numba engine.
|
reference/api/pandas.core.window.expanding.Expanding.max.html
|
pandas.tseries.offsets.Week.rollback
|
`pandas.tseries.offsets.Week.rollback`
Roll provided date backward to next offset only if not on offset.
Rolled timestamp if not on offset, otherwise unchanged timestamp.
|
Week.rollback()#
Roll provided date backward to next offset only if not on offset.
Returns
TimeStampRolled timestamp if not on offset, otherwise unchanged timestamp.
|
reference/api/pandas.tseries.offsets.Week.rollback.html
|
pandas.tseries.offsets.QuarterBegin.isAnchored
|
pandas.tseries.offsets.QuarterBegin.isAnchored
|
QuarterBegin.isAnchored()#
|
reference/api/pandas.tseries.offsets.QuarterBegin.isAnchored.html
|
Date offsets
|
Date offsets
|
DateOffset#
DateOffset
Standard kind of date increment used for a date range.
Properties#
DateOffset.freqstr
Return a string representing the frequency.
DateOffset.kwds
Return a dict of extra parameters for the offset.
DateOffset.name
Return a string representing the base frequency.
DateOffset.nanos
DateOffset.normalize
DateOffset.rule_code
DateOffset.n
DateOffset.is_month_start
Return boolean whether a timestamp occurs on the month start.
DateOffset.is_month_end
Return boolean whether a timestamp occurs on the month end.
Methods#
DateOffset.apply
DateOffset.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
DateOffset.copy
Return a copy of the frequency.
DateOffset.isAnchored
DateOffset.onOffset
DateOffset.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
DateOffset.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
DateOffset.__call__(*args, **kwargs)
Call self as a function.
DateOffset.is_month_start
Return boolean whether a timestamp occurs on the month start.
DateOffset.is_month_end
Return boolean whether a timestamp occurs on the month end.
DateOffset.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
DateOffset.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
DateOffset.is_year_start
Return boolean whether a timestamp occurs on the year start.
DateOffset.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessDay#
BusinessDay
DateOffset subclass representing possibly n business days.
Alias:
BDay
alias of pandas._libs.tslibs.offsets.BusinessDay
Properties#
BusinessDay.freqstr
Return a string representing the frequency.
BusinessDay.kwds
Return a dict of extra parameters for the offset.
BusinessDay.name
Return a string representing the base frequency.
BusinessDay.nanos
BusinessDay.normalize
BusinessDay.rule_code
BusinessDay.n
BusinessDay.weekmask
BusinessDay.holidays
BusinessDay.calendar
Methods#
BusinessDay.apply
BusinessDay.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessDay.copy
Return a copy of the frequency.
BusinessDay.isAnchored
BusinessDay.onOffset
BusinessDay.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessDay.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessDay.__call__(*args, **kwargs)
Call self as a function.
BusinessDay.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessDay.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessDay.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessDay.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessDay.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessDay.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessHour#
BusinessHour
DateOffset subclass representing possibly n business hours.
Properties#
BusinessHour.freqstr
Return a string representing the frequency.
BusinessHour.kwds
Return a dict of extra parameters for the offset.
BusinessHour.name
Return a string representing the base frequency.
BusinessHour.nanos
BusinessHour.normalize
BusinessHour.rule_code
BusinessHour.n
BusinessHour.start
BusinessHour.end
BusinessHour.weekmask
BusinessHour.holidays
BusinessHour.calendar
Methods#
BusinessHour.apply
BusinessHour.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessHour.copy
Return a copy of the frequency.
BusinessHour.isAnchored
BusinessHour.onOffset
BusinessHour.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessHour.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessHour.__call__(*args, **kwargs)
Call self as a function.
BusinessHour.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessHour.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessHour.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessHour.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessHour.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessHour.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessDay#
CustomBusinessDay
DateOffset subclass representing custom business days excluding holidays.
Alias:
CDay
alias of pandas._libs.tslibs.offsets.CustomBusinessDay
Properties#
CustomBusinessDay.freqstr
Return a string representing the frequency.
CustomBusinessDay.kwds
Return a dict of extra parameters for the offset.
CustomBusinessDay.name
Return a string representing the base frequency.
CustomBusinessDay.nanos
CustomBusinessDay.normalize
CustomBusinessDay.rule_code
CustomBusinessDay.n
CustomBusinessDay.weekmask
CustomBusinessDay.calendar
CustomBusinessDay.holidays
Methods#
CustomBusinessDay.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessDay.apply
CustomBusinessDay.copy
Return a copy of the frequency.
CustomBusinessDay.isAnchored
CustomBusinessDay.onOffset
CustomBusinessDay.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessDay.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessDay.__call__(*args, **kwargs)
Call self as a function.
CustomBusinessDay.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessDay.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessDay.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessDay.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessDay.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessDay.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessHour#
CustomBusinessHour
DateOffset subclass representing possibly n custom business days.
Properties#
CustomBusinessHour.freqstr
Return a string representing the frequency.
CustomBusinessHour.kwds
Return a dict of extra parameters for the offset.
CustomBusinessHour.name
Return a string representing the base frequency.
CustomBusinessHour.nanos
CustomBusinessHour.normalize
CustomBusinessHour.rule_code
CustomBusinessHour.n
CustomBusinessHour.weekmask
CustomBusinessHour.calendar
CustomBusinessHour.holidays
CustomBusinessHour.start
CustomBusinessHour.end
Methods#
CustomBusinessHour.apply
CustomBusinessHour.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessHour.copy
Return a copy of the frequency.
CustomBusinessHour.isAnchored
CustomBusinessHour.onOffset
CustomBusinessHour.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessHour.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessHour.__call__(*args, **kwargs)
Call self as a function.
CustomBusinessHour.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessHour.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessHour.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessHour.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessHour.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessHour.is_year_end
Return boolean whether a timestamp occurs on the year end.
MonthEnd#
MonthEnd
DateOffset of one month end.
Properties#
MonthEnd.freqstr
Return a string representing the frequency.
MonthEnd.kwds
Return a dict of extra parameters for the offset.
MonthEnd.name
Return a string representing the base frequency.
MonthEnd.nanos
MonthEnd.normalize
MonthEnd.rule_code
MonthEnd.n
Methods#
MonthEnd.apply
MonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
MonthEnd.copy
Return a copy of the frequency.
MonthEnd.isAnchored
MonthEnd.onOffset
MonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
MonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
MonthEnd.__call__(*args, **kwargs)
Call self as a function.
MonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
MonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
MonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
MonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
MonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
MonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
MonthBegin#
MonthBegin
DateOffset of one month at beginning.
Properties#
MonthBegin.freqstr
Return a string representing the frequency.
MonthBegin.kwds
Return a dict of extra parameters for the offset.
MonthBegin.name
Return a string representing the base frequency.
MonthBegin.nanos
MonthBegin.normalize
MonthBegin.rule_code
MonthBegin.n
Methods#
MonthBegin.apply
MonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
MonthBegin.copy
Return a copy of the frequency.
MonthBegin.isAnchored
MonthBegin.onOffset
MonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
MonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
MonthBegin.__call__(*args, **kwargs)
Call self as a function.
MonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
MonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
MonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
MonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
MonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
MonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessMonthEnd#
BusinessMonthEnd
DateOffset increments between the last business day of the month.
Alias:
BMonthEnd
alias of pandas._libs.tslibs.offsets.BusinessMonthEnd
Properties#
BusinessMonthEnd.freqstr
Return a string representing the frequency.
BusinessMonthEnd.kwds
Return a dict of extra parameters for the offset.
BusinessMonthEnd.name
Return a string representing the base frequency.
BusinessMonthEnd.nanos
BusinessMonthEnd.normalize
BusinessMonthEnd.rule_code
BusinessMonthEnd.n
Methods#
BusinessMonthEnd.apply
BusinessMonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessMonthEnd.copy
Return a copy of the frequency.
BusinessMonthEnd.isAnchored
BusinessMonthEnd.onOffset
BusinessMonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessMonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessMonthEnd.__call__(*args, **kwargs)
Call self as a function.
BusinessMonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessMonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessMonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessMonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessMonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessMonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessMonthBegin#
BusinessMonthBegin
DateOffset of one month at the first business day.
Alias:
BMonthBegin
alias of pandas._libs.tslibs.offsets.BusinessMonthBegin
Properties#
BusinessMonthBegin.freqstr
Return a string representing the frequency.
BusinessMonthBegin.kwds
Return a dict of extra parameters for the offset.
BusinessMonthBegin.name
Return a string representing the base frequency.
BusinessMonthBegin.nanos
BusinessMonthBegin.normalize
BusinessMonthBegin.rule_code
BusinessMonthBegin.n
Methods#
BusinessMonthBegin.apply
BusinessMonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessMonthBegin.copy
Return a copy of the frequency.
BusinessMonthBegin.isAnchored
BusinessMonthBegin.onOffset
BusinessMonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessMonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessMonthBegin.__call__(*args, **kwargs)
Call self as a function.
BusinessMonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessMonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessMonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessMonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessMonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessMonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessMonthEnd#
CustomBusinessMonthEnd
Attributes
Alias:
CBMonthEnd
alias of pandas._libs.tslibs.offsets.CustomBusinessMonthEnd
Properties#
CustomBusinessMonthEnd.freqstr
Return a string representing the frequency.
CustomBusinessMonthEnd.kwds
Return a dict of extra parameters for the offset.
CustomBusinessMonthEnd.m_offset
CustomBusinessMonthEnd.name
Return a string representing the base frequency.
CustomBusinessMonthEnd.nanos
CustomBusinessMonthEnd.normalize
CustomBusinessMonthEnd.rule_code
CustomBusinessMonthEnd.n
CustomBusinessMonthEnd.weekmask
CustomBusinessMonthEnd.calendar
CustomBusinessMonthEnd.holidays
Methods#
CustomBusinessMonthEnd.apply
CustomBusinessMonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessMonthEnd.copy
Return a copy of the frequency.
CustomBusinessMonthEnd.isAnchored
CustomBusinessMonthEnd.onOffset
CustomBusinessMonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessMonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessMonthEnd.__call__(*args, **kwargs)
Call self as a function.
CustomBusinessMonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessMonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessMonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessMonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessMonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessMonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessMonthBegin#
CustomBusinessMonthBegin
Attributes
Alias:
CBMonthBegin
alias of pandas._libs.tslibs.offsets.CustomBusinessMonthBegin
Properties#
CustomBusinessMonthBegin.freqstr
Return a string representing the frequency.
CustomBusinessMonthBegin.kwds
Return a dict of extra parameters for the offset.
CustomBusinessMonthBegin.m_offset
CustomBusinessMonthBegin.name
Return a string representing the base frequency.
CustomBusinessMonthBegin.nanos
CustomBusinessMonthBegin.normalize
CustomBusinessMonthBegin.rule_code
CustomBusinessMonthBegin.n
CustomBusinessMonthBegin.weekmask
CustomBusinessMonthBegin.calendar
CustomBusinessMonthBegin.holidays
Methods#
CustomBusinessMonthBegin.apply
CustomBusinessMonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessMonthBegin.copy
Return a copy of the frequency.
CustomBusinessMonthBegin.isAnchored
CustomBusinessMonthBegin.onOffset
CustomBusinessMonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessMonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessMonthBegin.__call__(*args, ...)
Call self as a function.
CustomBusinessMonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessMonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessMonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessMonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessMonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessMonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
SemiMonthEnd#
SemiMonthEnd
Two DateOffset's per month repeating on the last day of the month & day_of_month.
Properties#
SemiMonthEnd.freqstr
Return a string representing the frequency.
SemiMonthEnd.kwds
Return a dict of extra parameters for the offset.
SemiMonthEnd.name
Return a string representing the base frequency.
SemiMonthEnd.nanos
SemiMonthEnd.normalize
SemiMonthEnd.rule_code
SemiMonthEnd.n
SemiMonthEnd.day_of_month
Methods#
SemiMonthEnd.apply
SemiMonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
SemiMonthEnd.copy
Return a copy of the frequency.
SemiMonthEnd.isAnchored
SemiMonthEnd.onOffset
SemiMonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
SemiMonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
SemiMonthEnd.__call__(*args, **kwargs)
Call self as a function.
SemiMonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
SemiMonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
SemiMonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
SemiMonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
SemiMonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
SemiMonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
SemiMonthBegin#
SemiMonthBegin
Two DateOffset's per month repeating on the first day of the month & day_of_month.
Properties#
SemiMonthBegin.freqstr
Return a string representing the frequency.
SemiMonthBegin.kwds
Return a dict of extra parameters for the offset.
SemiMonthBegin.name
Return a string representing the base frequency.
SemiMonthBegin.nanos
SemiMonthBegin.normalize
SemiMonthBegin.rule_code
SemiMonthBegin.n
SemiMonthBegin.day_of_month
Methods#
SemiMonthBegin.apply
SemiMonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
SemiMonthBegin.copy
Return a copy of the frequency.
SemiMonthBegin.isAnchored
SemiMonthBegin.onOffset
SemiMonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
SemiMonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
SemiMonthBegin.__call__(*args, **kwargs)
Call self as a function.
SemiMonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
SemiMonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
SemiMonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
SemiMonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
SemiMonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
SemiMonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
Week#
Week
Weekly offset.
Properties#
Week.freqstr
Return a string representing the frequency.
Week.kwds
Return a dict of extra parameters for the offset.
Week.name
Return a string representing the base frequency.
Week.nanos
Week.normalize
Week.rule_code
Week.n
Week.weekday
Methods#
Week.apply
Week.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Week.copy
Return a copy of the frequency.
Week.isAnchored
Week.onOffset
Week.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Week.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Week.__call__(*args, **kwargs)
Call self as a function.
Week.is_month_start
Return boolean whether a timestamp occurs on the month start.
Week.is_month_end
Return boolean whether a timestamp occurs on the month end.
Week.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Week.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Week.is_year_start
Return boolean whether a timestamp occurs on the year start.
Week.is_year_end
Return boolean whether a timestamp occurs on the year end.
WeekOfMonth#
WeekOfMonth
Describes monthly dates like "the Tuesday of the 2nd week of each month".
Properties#
WeekOfMonth.freqstr
Return a string representing the frequency.
WeekOfMonth.kwds
Return a dict of extra parameters for the offset.
WeekOfMonth.name
Return a string representing the base frequency.
WeekOfMonth.nanos
WeekOfMonth.normalize
WeekOfMonth.rule_code
WeekOfMonth.n
WeekOfMonth.week
Methods#
WeekOfMonth.apply
WeekOfMonth.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
WeekOfMonth.copy
Return a copy of the frequency.
WeekOfMonth.isAnchored
WeekOfMonth.onOffset
WeekOfMonth.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
WeekOfMonth.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
WeekOfMonth.__call__(*args, **kwargs)
Call self as a function.
WeekOfMonth.weekday
WeekOfMonth.is_month_start
Return boolean whether a timestamp occurs on the month start.
WeekOfMonth.is_month_end
Return boolean whether a timestamp occurs on the month end.
WeekOfMonth.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
WeekOfMonth.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
WeekOfMonth.is_year_start
Return boolean whether a timestamp occurs on the year start.
WeekOfMonth.is_year_end
Return boolean whether a timestamp occurs on the year end.
LastWeekOfMonth#
LastWeekOfMonth
Describes monthly dates in last week of month.
Properties#
LastWeekOfMonth.freqstr
Return a string representing the frequency.
LastWeekOfMonth.kwds
Return a dict of extra parameters for the offset.
LastWeekOfMonth.name
Return a string representing the base frequency.
LastWeekOfMonth.nanos
LastWeekOfMonth.normalize
LastWeekOfMonth.rule_code
LastWeekOfMonth.n
LastWeekOfMonth.weekday
LastWeekOfMonth.week
Methods#
LastWeekOfMonth.apply
LastWeekOfMonth.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
LastWeekOfMonth.copy
Return a copy of the frequency.
LastWeekOfMonth.isAnchored
LastWeekOfMonth.onOffset
LastWeekOfMonth.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
LastWeekOfMonth.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
LastWeekOfMonth.__call__(*args, **kwargs)
Call self as a function.
LastWeekOfMonth.is_month_start
Return boolean whether a timestamp occurs on the month start.
LastWeekOfMonth.is_month_end
Return boolean whether a timestamp occurs on the month end.
LastWeekOfMonth.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
LastWeekOfMonth.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
LastWeekOfMonth.is_year_start
Return boolean whether a timestamp occurs on the year start.
LastWeekOfMonth.is_year_end
Return boolean whether a timestamp occurs on the year end.
BQuarterEnd#
BQuarterEnd
DateOffset increments between the last business day of each Quarter.
Properties#
BQuarterEnd.freqstr
Return a string representing the frequency.
BQuarterEnd.kwds
Return a dict of extra parameters for the offset.
BQuarterEnd.name
Return a string representing the base frequency.
BQuarterEnd.nanos
BQuarterEnd.normalize
BQuarterEnd.rule_code
BQuarterEnd.n
BQuarterEnd.startingMonth
Methods#
BQuarterEnd.apply
BQuarterEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BQuarterEnd.copy
Return a copy of the frequency.
BQuarterEnd.isAnchored
BQuarterEnd.onOffset
BQuarterEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BQuarterEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BQuarterEnd.__call__(*args, **kwargs)
Call self as a function.
BQuarterEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
BQuarterEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
BQuarterEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BQuarterEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BQuarterEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
BQuarterEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
BQuarterBegin#
BQuarterBegin
DateOffset increments between the first business day of each Quarter.
Properties#
BQuarterBegin.freqstr
Return a string representing the frequency.
BQuarterBegin.kwds
Return a dict of extra parameters for the offset.
BQuarterBegin.name
Return a string representing the base frequency.
BQuarterBegin.nanos
BQuarterBegin.normalize
BQuarterBegin.rule_code
BQuarterBegin.n
BQuarterBegin.startingMonth
Methods#
BQuarterBegin.apply
BQuarterBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BQuarterBegin.copy
Return a copy of the frequency.
BQuarterBegin.isAnchored
BQuarterBegin.onOffset
BQuarterBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BQuarterBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BQuarterBegin.__call__(*args, **kwargs)
Call self as a function.
BQuarterBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
BQuarterBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
BQuarterBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BQuarterBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BQuarterBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
BQuarterBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
QuarterEnd#
QuarterEnd
DateOffset increments between Quarter end dates.
Properties#
QuarterEnd.freqstr
Return a string representing the frequency.
QuarterEnd.kwds
Return a dict of extra parameters for the offset.
QuarterEnd.name
Return a string representing the base frequency.
QuarterEnd.nanos
QuarterEnd.normalize
QuarterEnd.rule_code
QuarterEnd.n
QuarterEnd.startingMonth
Methods#
QuarterEnd.apply
QuarterEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
QuarterEnd.copy
Return a copy of the frequency.
QuarterEnd.isAnchored
QuarterEnd.onOffset
QuarterEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
QuarterEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
QuarterEnd.__call__(*args, **kwargs)
Call self as a function.
QuarterEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
QuarterEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
QuarterEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
QuarterEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
QuarterEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
QuarterEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
QuarterBegin#
QuarterBegin
DateOffset increments between Quarter start dates.
Properties#
QuarterBegin.freqstr
Return a string representing the frequency.
QuarterBegin.kwds
Return a dict of extra parameters for the offset.
QuarterBegin.name
Return a string representing the base frequency.
QuarterBegin.nanos
QuarterBegin.normalize
QuarterBegin.rule_code
QuarterBegin.n
QuarterBegin.startingMonth
Methods#
QuarterBegin.apply
QuarterBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
QuarterBegin.copy
Return a copy of the frequency.
QuarterBegin.isAnchored
QuarterBegin.onOffset
QuarterBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
QuarterBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
QuarterBegin.__call__(*args, **kwargs)
Call self as a function.
QuarterBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
QuarterBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
QuarterBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
QuarterBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
QuarterBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
QuarterBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
BYearEnd#
BYearEnd
DateOffset increments between the last business day of the year.
Properties#
BYearEnd.freqstr
Return a string representing the frequency.
BYearEnd.kwds
Return a dict of extra parameters for the offset.
BYearEnd.name
Return a string representing the base frequency.
BYearEnd.nanos
BYearEnd.normalize
BYearEnd.rule_code
BYearEnd.n
BYearEnd.month
Methods#
BYearEnd.apply
BYearEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BYearEnd.copy
Return a copy of the frequency.
BYearEnd.isAnchored
BYearEnd.onOffset
BYearEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BYearEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BYearEnd.__call__(*args, **kwargs)
Call self as a function.
BYearEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
BYearEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
BYearEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BYearEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BYearEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
BYearEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
BYearBegin#
BYearBegin
DateOffset increments between the first business day of the year.
Properties#
BYearBegin.freqstr
Return a string representing the frequency.
BYearBegin.kwds
Return a dict of extra parameters for the offset.
BYearBegin.name
Return a string representing the base frequency.
BYearBegin.nanos
BYearBegin.normalize
BYearBegin.rule_code
BYearBegin.n
BYearBegin.month
Methods#
BYearBegin.apply
BYearBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BYearBegin.copy
Return a copy of the frequency.
BYearBegin.isAnchored
BYearBegin.onOffset
BYearBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BYearBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BYearBegin.__call__(*args, **kwargs)
Call self as a function.
BYearBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
BYearBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
BYearBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BYearBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BYearBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
BYearBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
YearEnd#
YearEnd
DateOffset increments between calendar year ends.
Properties#
YearEnd.freqstr
Return a string representing the frequency.
YearEnd.kwds
Return a dict of extra parameters for the offset.
YearEnd.name
Return a string representing the base frequency.
YearEnd.nanos
YearEnd.normalize
YearEnd.rule_code
YearEnd.n
YearEnd.month
Methods#
YearEnd.apply
YearEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
YearEnd.copy
Return a copy of the frequency.
YearEnd.isAnchored
YearEnd.onOffset
YearEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
YearEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
YearEnd.__call__(*args, **kwargs)
Call self as a function.
YearEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
YearEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
YearEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
YearEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
YearEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
YearEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
YearBegin#
YearBegin
DateOffset increments between calendar year begin dates.
Properties#
YearBegin.freqstr
Return a string representing the frequency.
YearBegin.kwds
Return a dict of extra parameters for the offset.
YearBegin.name
Return a string representing the base frequency.
YearBegin.nanos
YearBegin.normalize
YearBegin.rule_code
YearBegin.n
YearBegin.month
Methods#
YearBegin.apply
YearBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
YearBegin.copy
Return a copy of the frequency.
YearBegin.isAnchored
YearBegin.onOffset
YearBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
YearBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
YearBegin.__call__(*args, **kwargs)
Call self as a function.
YearBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
YearBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
YearBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
YearBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
YearBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
YearBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
FY5253#
FY5253
Describes 52-53 week fiscal year.
Properties#
FY5253.freqstr
Return a string representing the frequency.
FY5253.kwds
Return a dict of extra parameters for the offset.
FY5253.name
Return a string representing the base frequency.
FY5253.nanos
FY5253.normalize
FY5253.rule_code
FY5253.n
FY5253.startingMonth
FY5253.variation
FY5253.weekday
Methods#
FY5253.apply
FY5253.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
FY5253.copy
Return a copy of the frequency.
FY5253.get_rule_code_suffix
FY5253.get_year_end
FY5253.isAnchored
FY5253.onOffset
FY5253.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
FY5253.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
FY5253.__call__(*args, **kwargs)
Call self as a function.
FY5253.is_month_start
Return boolean whether a timestamp occurs on the month start.
FY5253.is_month_end
Return boolean whether a timestamp occurs on the month end.
FY5253.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
FY5253.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
FY5253.is_year_start
Return boolean whether a timestamp occurs on the year start.
FY5253.is_year_end
Return boolean whether a timestamp occurs on the year end.
FY5253Quarter#
FY5253Quarter
DateOffset increments between business quarter dates for 52-53 week fiscal year.
Properties#
FY5253Quarter.freqstr
Return a string representing the frequency.
FY5253Quarter.kwds
Return a dict of extra parameters for the offset.
FY5253Quarter.name
Return a string representing the base frequency.
FY5253Quarter.nanos
FY5253Quarter.normalize
FY5253Quarter.rule_code
FY5253Quarter.n
FY5253Quarter.qtr_with_extra_week
FY5253Quarter.startingMonth
FY5253Quarter.variation
FY5253Quarter.weekday
Methods#
FY5253Quarter.apply
FY5253Quarter.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
FY5253Quarter.copy
Return a copy of the frequency.
FY5253Quarter.get_rule_code_suffix
FY5253Quarter.get_weeks
FY5253Quarter.isAnchored
FY5253Quarter.onOffset
FY5253Quarter.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
FY5253Quarter.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
FY5253Quarter.year_has_extra_week
FY5253Quarter.__call__(*args, **kwargs)
Call self as a function.
FY5253Quarter.is_month_start
Return boolean whether a timestamp occurs on the month start.
FY5253Quarter.is_month_end
Return boolean whether a timestamp occurs on the month end.
FY5253Quarter.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
FY5253Quarter.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
FY5253Quarter.is_year_start
Return boolean whether a timestamp occurs on the year start.
FY5253Quarter.is_year_end
Return boolean whether a timestamp occurs on the year end.
Easter#
Easter
DateOffset for the Easter holiday using logic defined in dateutil.
Properties#
Easter.freqstr
Return a string representing the frequency.
Easter.kwds
Return a dict of extra parameters for the offset.
Easter.name
Return a string representing the base frequency.
Easter.nanos
Easter.normalize
Easter.rule_code
Easter.n
Methods#
Easter.apply
Easter.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Easter.copy
Return a copy of the frequency.
Easter.isAnchored
Easter.onOffset
Easter.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Easter.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Easter.__call__(*args, **kwargs)
Call self as a function.
Easter.is_month_start
Return boolean whether a timestamp occurs on the month start.
Easter.is_month_end
Return boolean whether a timestamp occurs on the month end.
Easter.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Easter.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Easter.is_year_start
Return boolean whether a timestamp occurs on the year start.
Easter.is_year_end
Return boolean whether a timestamp occurs on the year end.
Tick#
Tick
Attributes
Properties#
Tick.delta
Tick.freqstr
Return a string representing the frequency.
Tick.kwds
Return a dict of extra parameters for the offset.
Tick.name
Return a string representing the base frequency.
Tick.nanos
Return an integer of the total number of nanoseconds.
Tick.normalize
Tick.rule_code
Tick.n
Methods#
Tick.copy
Return a copy of the frequency.
Tick.isAnchored
Tick.onOffset
Tick.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Tick.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Tick.__call__(*args, **kwargs)
Call self as a function.
Tick.apply
Tick.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Tick.is_month_start
Return boolean whether a timestamp occurs on the month start.
Tick.is_month_end
Return boolean whether a timestamp occurs on the month end.
Tick.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Tick.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Tick.is_year_start
Return boolean whether a timestamp occurs on the year start.
Tick.is_year_end
Return boolean whether a timestamp occurs on the year end.
Day#
Day
Attributes
Properties#
Day.delta
Day.freqstr
Return a string representing the frequency.
Day.kwds
Return a dict of extra parameters for the offset.
Day.name
Return a string representing the base frequency.
Day.nanos
Return an integer of the total number of nanoseconds.
Day.normalize
Day.rule_code
Day.n
Methods#
Day.copy
Return a copy of the frequency.
Day.isAnchored
Day.onOffset
Day.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Day.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Day.__call__(*args, **kwargs)
Call self as a function.
Day.apply
Day.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Day.is_month_start
Return boolean whether a timestamp occurs on the month start.
Day.is_month_end
Return boolean whether a timestamp occurs on the month end.
Day.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Day.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Day.is_year_start
Return boolean whether a timestamp occurs on the year start.
Day.is_year_end
Return boolean whether a timestamp occurs on the year end.
Hour#
Hour
Attributes
Properties#
Hour.delta
Hour.freqstr
Return a string representing the frequency.
Hour.kwds
Return a dict of extra parameters for the offset.
Hour.name
Return a string representing the base frequency.
Hour.nanos
Return an integer of the total number of nanoseconds.
Hour.normalize
Hour.rule_code
Hour.n
Methods#
Hour.copy
Return a copy of the frequency.
Hour.isAnchored
Hour.onOffset
Hour.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Hour.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Hour.__call__(*args, **kwargs)
Call self as a function.
Hour.apply
Hour.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Hour.is_month_start
Return boolean whether a timestamp occurs on the month start.
Hour.is_month_end
Return boolean whether a timestamp occurs on the month end.
Hour.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Hour.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Hour.is_year_start
Return boolean whether a timestamp occurs on the year start.
Hour.is_year_end
Return boolean whether a timestamp occurs on the year end.
Minute#
Minute
Attributes
Properties#
Minute.delta
Minute.freqstr
Return a string representing the frequency.
Minute.kwds
Return a dict of extra parameters for the offset.
Minute.name
Return a string representing the base frequency.
Minute.nanos
Return an integer of the total number of nanoseconds.
Minute.normalize
Minute.rule_code
Minute.n
Methods#
Minute.copy
Return a copy of the frequency.
Minute.isAnchored
Minute.onOffset
Minute.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Minute.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Minute.__call__(*args, **kwargs)
Call self as a function.
Minute.apply
Minute.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Minute.is_month_start
Return boolean whether a timestamp occurs on the month start.
Minute.is_month_end
Return boolean whether a timestamp occurs on the month end.
Minute.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Minute.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Minute.is_year_start
Return boolean whether a timestamp occurs on the year start.
Minute.is_year_end
Return boolean whether a timestamp occurs on the year end.
Second#
Second
Attributes
Properties#
Second.delta
Second.freqstr
Return a string representing the frequency.
Second.kwds
Return a dict of extra parameters for the offset.
Second.name
Return a string representing the base frequency.
Second.nanos
Return an integer of the total number of nanoseconds.
Second.normalize
Second.rule_code
Second.n
Methods#
Second.copy
Return a copy of the frequency.
Second.isAnchored
Second.onOffset
Second.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Second.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Second.__call__(*args, **kwargs)
Call self as a function.
Second.apply
Second.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Second.is_month_start
Return boolean whether a timestamp occurs on the month start.
Second.is_month_end
Return boolean whether a timestamp occurs on the month end.
Second.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Second.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Second.is_year_start
Return boolean whether a timestamp occurs on the year start.
Second.is_year_end
Return boolean whether a timestamp occurs on the year end.
Milli#
Milli
Attributes
Properties#
Milli.delta
Milli.freqstr
Return a string representing the frequency.
Milli.kwds
Return a dict of extra parameters for the offset.
Milli.name
Return a string representing the base frequency.
Milli.nanos
Return an integer of the total number of nanoseconds.
Milli.normalize
Milli.rule_code
Milli.n
Methods#
Milli.copy
Return a copy of the frequency.
Milli.isAnchored
Milli.onOffset
Milli.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Milli.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Milli.__call__(*args, **kwargs)
Call self as a function.
Milli.apply
Milli.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Milli.is_month_start
Return boolean whether a timestamp occurs on the month start.
Milli.is_month_end
Return boolean whether a timestamp occurs on the month end.
Milli.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Milli.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Milli.is_year_start
Return boolean whether a timestamp occurs on the year start.
Milli.is_year_end
Return boolean whether a timestamp occurs on the year end.
Micro#
Micro
Attributes
Properties#
Micro.delta
Micro.freqstr
Return a string representing the frequency.
Micro.kwds
Return a dict of extra parameters for the offset.
Micro.name
Return a string representing the base frequency.
Micro.nanos
Return an integer of the total number of nanoseconds.
Micro.normalize
Micro.rule_code
Micro.n
Methods#
Micro.copy
Return a copy of the frequency.
Micro.isAnchored
Micro.onOffset
Micro.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Micro.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Micro.__call__(*args, **kwargs)
Call self as a function.
Micro.apply
Micro.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Micro.is_month_start
Return boolean whether a timestamp occurs on the month start.
Micro.is_month_end
Return boolean whether a timestamp occurs on the month end.
Micro.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Micro.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Micro.is_year_start
Return boolean whether a timestamp occurs on the year start.
Micro.is_year_end
Return boolean whether a timestamp occurs on the year end.
Nano#
Nano
Attributes
Properties#
Nano.delta
Nano.freqstr
Return a string representing the frequency.
Nano.kwds
Return a dict of extra parameters for the offset.
Nano.name
Return a string representing the base frequency.
Nano.nanos
Return an integer of the total number of nanoseconds.
Nano.normalize
Nano.rule_code
Nano.n
Methods#
Nano.copy
Return a copy of the frequency.
Nano.isAnchored
Nano.onOffset
Nano.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Nano.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Nano.__call__(*args, **kwargs)
Call self as a function.
Nano.apply
Nano.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Nano.is_month_start
Return boolean whether a timestamp occurs on the month start.
Nano.is_month_end
Return boolean whether a timestamp occurs on the month end.
Nano.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Nano.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Nano.is_year_start
Return boolean whether a timestamp occurs on the year start.
Nano.is_year_end
Return boolean whether a timestamp occurs on the year end.
Frequencies#
to_offset
Return DateOffset object from string or datetime.timedelta object.
|
reference/offset_frequency.html
|
pandas.tseries.offsets.CustomBusinessDay.is_month_start
|
`pandas.tseries.offsets.CustomBusinessDay.is_month_start`
Return boolean whether a timestamp occurs on the month start.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_start(ts)
True
```
|
CustomBusinessDay.is_month_start()#
Return boolean whether a timestamp occurs on the month start.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_start(ts)
True
|
reference/api/pandas.tseries.offsets.CustomBusinessDay.is_month_start.html
|
pandas.Index.to_numpy
|
`pandas.Index.to_numpy`
A NumPy ndarray representing the values in this Series or Index.
```
>>> ser = pd.Series(pd.Categorical(['a', 'b', 'a']))
>>> ser.to_numpy()
array(['a', 'b', 'a'], dtype=object)
```
|
Index.to_numpy(dtype=None, copy=False, na_value=_NoDefault.no_default, **kwargs)[source]#
A NumPy ndarray representing the values in this Series or Index.
Parameters
dtypestr or numpy.dtype, optionalThe dtype to pass to numpy.asarray().
copybool, default FalseWhether to ensure that the returned value is not a view on
another array. Note that copy=False does not ensure that
to_numpy() is no-copy. Rather, copy=True ensure that
a copy is made, even if not strictly necessary.
na_valueAny, optionalThe value to use for missing values. The default value depends
on dtype and the type of the array.
New in version 1.0.0.
**kwargsAdditional keywords passed through to the to_numpy method
of the underlying array (for extension arrays).
New in version 1.0.0.
Returns
numpy.ndarray
See also
Series.arrayGet the actual data stored within.
Index.arrayGet the actual data stored within.
DataFrame.to_numpySimilar method for DataFrame.
Notes
The returned array will be the same up to equality (values equal
in self will be equal in the returned array; likewise for values
that are not equal). When self contains an ExtensionArray, the
dtype may be different. For example, for a category-dtype Series,
to_numpy() will return a NumPy array and the categorical dtype
will be lost.
For NumPy dtypes, this will be a reference to the actual data stored
in this Series or Index (assuming copy=False). Modifying the result
in place will modify the data stored in the Series or Index (not that
we recommend doing that).
For extension types, to_numpy() may require copying data and
coercing the result to a NumPy type (possibly object), which may be
expensive. When you need a no-copy reference to the underlying data,
Series.array should be used instead.
This table lays out the different dtypes and default return types of
to_numpy() for various dtypes within pandas.
dtype
array type
category[T]
ndarray[T] (same dtype as input)
period
ndarray[object] (Periods)
interval
ndarray[object] (Intervals)
IntegerNA
ndarray[object]
datetime64[ns]
datetime64[ns]
datetime64[ns, tz]
ndarray[object] (Timestamps)
Examples
>>> ser = pd.Series(pd.Categorical(['a', 'b', 'a']))
>>> ser.to_numpy()
array(['a', 'b', 'a'], dtype=object)
Specify the dtype to control how datetime-aware data is represented.
Use dtype=object to return an ndarray of pandas Timestamp
objects, each with the correct tz.
>>> ser = pd.Series(pd.date_range('2000', periods=2, tz="CET"))
>>> ser.to_numpy(dtype=object)
array([Timestamp('2000-01-01 00:00:00+0100', tz='CET'),
Timestamp('2000-01-02 00:00:00+0100', tz='CET')],
dtype=object)
Or dtype='datetime64[ns]' to return an ndarray of native
datetime64 values. The values are converted to UTC and the timezone
info is dropped.
>>> ser.to_numpy(dtype="datetime64[ns]")
...
array(['1999-12-31T23:00:00.000000000', '2000-01-01T23:00:00...'],
dtype='datetime64[ns]')
|
reference/api/pandas.Index.to_numpy.html
|
pandas.Series.head
|
`pandas.Series.head`
Return the first n rows.
This function returns the first n rows for the object based
on position. It is useful for quickly testing if your object
has the right type of data in it.
```
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
... 'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
animal
0 alligator
1 bee
2 falcon
3 lion
4 monkey
5 parrot
6 shark
7 whale
8 zebra
```
|
Series.head(n=5)[source]#
Return the first n rows.
This function returns the first n rows for the object based
on position. It is useful for quickly testing if your object
has the right type of data in it.
For negative values of n, this function returns all rows except
the last |n| rows, equivalent to df[:n].
If n is larger than the number of rows, this function returns all rows.
Parameters
nint, default 5Number of rows to select.
Returns
same type as callerThe first n rows of the caller object.
See also
DataFrame.tailReturns the last n rows.
Examples
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
... 'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
animal
0 alligator
1 bee
2 falcon
3 lion
4 monkey
5 parrot
6 shark
7 whale
8 zebra
Viewing the first 5 lines
>>> df.head()
animal
0 alligator
1 bee
2 falcon
3 lion
4 monkey
Viewing the first n lines (three in this case)
>>> df.head(3)
animal
0 alligator
1 bee
2 falcon
For negative values of n
>>> df.head(-3)
animal
0 alligator
1 bee
2 falcon
3 lion
4 monkey
5 parrot
|
reference/api/pandas.Series.head.html
|
pandas.tseries.offsets.CustomBusinessMonthEnd
|
`pandas.tseries.offsets.CustomBusinessMonthEnd`
Attributes
|
class pandas.tseries.offsets.CustomBusinessMonthEnd#
Attributes
base
Returns a copy of the calling offset object with n=1 and all other attributes equal.
cbday_roll
Define default roll function to be called in apply method.
freqstr
Return a string representing the frequency.
kwds
Return a dict of extra parameters for the offset.
month_roll
Define default roll function to be called in apply method.
name
Return a string representing the base frequency.
offset
Alias for self._offset.
calendar
holidays
m_offset
n
nanos
normalize
rule_code
weekmask
Methods
__call__(*args, **kwargs)
Call self as a function.
apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
copy
Return a copy of the frequency.
is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
is_month_end
Return boolean whether a timestamp occurs on the month end.
is_month_start
Return boolean whether a timestamp occurs on the month start.
is_on_offset
Return boolean whether a timestamp intersects with this frequency.
is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
is_year_end
Return boolean whether a timestamp occurs on the year end.
is_year_start
Return boolean whether a timestamp occurs on the year start.
rollback
Roll provided date backward to next offset only if not on offset.
rollforward
Roll provided date forward to next offset only if not on offset.
apply
isAnchored
onOffset
|
reference/api/pandas.tseries.offsets.CustomBusinessMonthEnd.html
|
pandas.Series.dt.is_quarter_start
|
`pandas.Series.dt.is_quarter_start`
Indicator for whether the date is the first day of a quarter.
The same type as the original data with boolean values. Series will
have the same name and index. DatetimeIndex will have the same
name.
```
>>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30",
... periods=4)})
>>> df.assign(quarter=df.dates.dt.quarter,
... is_quarter_start=df.dates.dt.is_quarter_start)
dates quarter is_quarter_start
0 2017-03-30 1 False
1 2017-03-31 1 False
2 2017-04-01 2 True
3 2017-04-02 2 False
```
|
Series.dt.is_quarter_start[source]#
Indicator for whether the date is the first day of a quarter.
Returns
is_quarter_startSeries or DatetimeIndexThe same type as the original data with boolean values. Series will
have the same name and index. DatetimeIndex will have the same
name.
See also
quarterReturn the quarter of the date.
is_quarter_endSimilar property for indicating the quarter start.
Examples
This method is available on Series with datetime values under
the .dt accessor, and directly on DatetimeIndex.
>>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30",
... periods=4)})
>>> df.assign(quarter=df.dates.dt.quarter,
... is_quarter_start=df.dates.dt.is_quarter_start)
dates quarter is_quarter_start
0 2017-03-30 1 False
1 2017-03-31 1 False
2 2017-04-01 2 True
3 2017-04-02 2 False
>>> idx = pd.date_range('2017-03-30', periods=4)
>>> idx
DatetimeIndex(['2017-03-30', '2017-03-31', '2017-04-01', '2017-04-02'],
dtype='datetime64[ns]', freq='D')
>>> idx.is_quarter_start
array([False, False, True, False])
|
reference/api/pandas.Series.dt.is_quarter_start.html
|
pandas.DataFrame.join
|
`pandas.DataFrame.join`
Join columns of another DataFrame.
```
>>> df = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'],
... 'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']})
```
|
DataFrame.join(other, on=None, how='left', lsuffix='', rsuffix='', sort=False, validate=None)[source]#
Join columns of another DataFrame.
Join columns with other DataFrame either on index or on a key
column. Efficiently join multiple DataFrame objects by index at once by
passing a list.
Parameters
otherDataFrame, Series, or a list containing any combination of themIndex should be similar to one of the columns in this one. If a
Series is passed, its name attribute must be set, and that will be
used as the column name in the resulting joined DataFrame.
onstr, list of str, or array-like, optionalColumn or index level name(s) in the caller to join on the index
in other, otherwise joins index-on-index. If multiple
values given, the other DataFrame must have a MultiIndex. Can
pass an array as the join key if it is not already contained in
the calling DataFrame. Like an Excel VLOOKUP operation.
how{‘left’, ‘right’, ‘outer’, ‘inner’}, default ‘left’How to handle the operation of the two objects.
left: use calling frame’s index (or column if on is specified)
right: use other’s index.
outer: form union of calling frame’s index (or column if on is
specified) with other’s index, and sort it.
lexicographically.
inner: form intersection of calling frame’s index (or column if
on is specified) with other’s index, preserving the order
of the calling’s one.
cross: creates the cartesian product from both frames, preserves the order
of the left keys.
New in version 1.2.0.
lsuffixstr, default ‘’Suffix to use from left frame’s overlapping columns.
rsuffixstr, default ‘’Suffix to use from right frame’s overlapping columns.
sortbool, default FalseOrder result DataFrame lexicographically by the join key. If False,
the order of the join key depends on the join type (how keyword).
validatestr, optionalIf specified, checks if join is of specified type.
* “one_to_one” or “1:1”: check if join keys are unique in both left
and right datasets.
* “one_to_many” or “1:m”: check if join keys are unique in left dataset.
* “many_to_one” or “m:1”: check if join keys are unique in right dataset.
* “many_to_many” or “m:m”: allowed, but does not result in checks.
.. versionadded:: 1.5.0
Returns
DataFrameA dataframe containing columns from both the caller and other.
See also
DataFrame.mergeFor column(s)-on-column(s) operations.
Notes
Parameters on, lsuffix, and rsuffix are not supported when
passing a list of DataFrame objects.
Support for specifying index levels as the on parameter was added
in version 0.23.0.
Examples
>>> df = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'],
... 'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']})
>>> df
key A
0 K0 A0
1 K1 A1
2 K2 A2
3 K3 A3
4 K4 A4
5 K5 A5
>>> other = pd.DataFrame({'key': ['K0', 'K1', 'K2'],
... 'B': ['B0', 'B1', 'B2']})
>>> other
key B
0 K0 B0
1 K1 B1
2 K2 B2
Join DataFrames using their indexes.
>>> df.join(other, lsuffix='_caller', rsuffix='_other')
key_caller A key_other B
0 K0 A0 K0 B0
1 K1 A1 K1 B1
2 K2 A2 K2 B2
3 K3 A3 NaN NaN
4 K4 A4 NaN NaN
5 K5 A5 NaN NaN
If we want to join using the key columns, we need to set key to be
the index in both df and other. The joined DataFrame will have
key as its index.
>>> df.set_index('key').join(other.set_index('key'))
A B
key
K0 A0 B0
K1 A1 B1
K2 A2 B2
K3 A3 NaN
K4 A4 NaN
K5 A5 NaN
Another option to join using the key columns is to use the on
parameter. DataFrame.join always uses other’s index but we can use
any column in df. This method preserves the original DataFrame’s
index in the result.
>>> df.join(other.set_index('key'), on='key')
key A B
0 K0 A0 B0
1 K1 A1 B1
2 K2 A2 B2
3 K3 A3 NaN
4 K4 A4 NaN
5 K5 A5 NaN
Using non-unique key values shows how they are matched.
>>> df = pd.DataFrame({'key': ['K0', 'K1', 'K1', 'K3', 'K0', 'K1'],
... 'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']})
>>> df
key A
0 K0 A0
1 K1 A1
2 K1 A2
3 K3 A3
4 K0 A4
5 K1 A5
>>> df.join(other.set_index('key'), on='key', validate='m:1')
key A B
0 K0 A0 B0
1 K1 A1 B1
2 K1 A2 B1
3 K3 A3 NaN
4 K0 A4 B0
5 K1 A5 B1
|
reference/api/pandas.DataFrame.join.html
|
pandas.tseries.offsets.Milli.copy
|
`pandas.tseries.offsets.Milli.copy`
Return a copy of the frequency.
```
>>> freq = pd.DateOffset(1)
>>> freq_copy = freq.copy()
>>> freq is freq_copy
False
```
|
Milli.copy()#
Return a copy of the frequency.
Examples
>>> freq = pd.DateOffset(1)
>>> freq_copy = freq.copy()
>>> freq is freq_copy
False
|
reference/api/pandas.tseries.offsets.Milli.copy.html
|
Input/output
|
Input/output
read_pickle(filepath_or_buffer[, ...])
Load pickled pandas object (or any object) from file.
DataFrame.to_pickle(path[, compression, ...])
Pickle (serialize) object to file.
read_table(filepath_or_buffer, *[, sep, ...])
|
Pickling#
read_pickle(filepath_or_buffer[, ...])
Load pickled pandas object (or any object) from file.
DataFrame.to_pickle(path[, compression, ...])
Pickle (serialize) object to file.
Flat file#
read_table(filepath_or_buffer, *[, sep, ...])
Read general delimited file into DataFrame.
read_csv(filepath_or_buffer, *[, sep, ...])
Read a comma-separated values (csv) file into DataFrame.
DataFrame.to_csv([path_or_buf, sep, na_rep, ...])
Write object to a comma-separated values (csv) file.
read_fwf(filepath_or_buffer, *[, colspecs, ...])
Read a table of fixed-width formatted lines into DataFrame.
Clipboard#
read_clipboard([sep])
Read text from clipboard and pass to read_csv.
DataFrame.to_clipboard([excel, sep])
Copy object to the system clipboard.
Excel#
read_excel(io[, sheet_name, header, names, ...])
Read an Excel file into a pandas DataFrame.
DataFrame.to_excel(excel_writer[, ...])
Write object to an Excel sheet.
ExcelFile.parse([sheet_name, header, names, ...])
Parse specified sheet(s) into a DataFrame.
Styler.to_excel(excel_writer[, sheet_name, ...])
Write Styler to an Excel sheet.
ExcelWriter(path[, engine, date_format, ...])
Class for writing DataFrame objects into excel sheets.
JSON#
read_json(path_or_buf, *[, orient, typ, ...])
Convert a JSON string to pandas object.
json_normalize(data[, record_path, meta, ...])
Normalize semi-structured JSON data into a flat table.
DataFrame.to_json([path_or_buf, orient, ...])
Convert the object to a JSON string.
build_table_schema(data[, index, ...])
Create a Table schema from data.
HTML#
read_html(io, *[, match, flavor, header, ...])
Read HTML tables into a list of DataFrame objects.
DataFrame.to_html([buf, columns, col_space, ...])
Render a DataFrame as an HTML table.
Styler.to_html([buf, table_uuid, ...])
Write Styler to a file, buffer or string in HTML-CSS format.
XML#
read_xml(path_or_buffer, *[, xpath, ...])
Read XML document into a DataFrame object.
DataFrame.to_xml([path_or_buffer, index, ...])
Render a DataFrame to an XML document.
Latex#
DataFrame.to_latex([buf, columns, ...])
Render object to a LaTeX tabular, longtable, or nested table.
Styler.to_latex([buf, column_format, ...])
Write Styler to a file, buffer or string in LaTeX format.
HDFStore: PyTables (HDF5)#
read_hdf(path_or_buf[, key, mode, errors, ...])
Read from the store, close it if we opened it.
HDFStore.put(key, value[, format, index, ...])
Store object in HDFStore.
HDFStore.append(key, value[, format, axes, ...])
Append to Table in file.
HDFStore.get(key)
Retrieve pandas object stored in file.
HDFStore.select(key[, where, start, stop, ...])
Retrieve pandas object stored in file, optionally based on where criteria.
HDFStore.info()
Print detailed information on the store.
HDFStore.keys([include])
Return a list of keys corresponding to objects stored in HDFStore.
HDFStore.groups()
Return a list of all the top-level nodes.
HDFStore.walk([where])
Walk the pytables group hierarchy for pandas objects.
Warning
One can store a subclass of DataFrame or Series to HDF5,
but the type of the subclass is lost upon storing.
Feather#
read_feather(path[, columns, use_threads, ...])
Load a feather-format object from the file path.
DataFrame.to_feather(path, **kwargs)
Write a DataFrame to the binary Feather format.
Parquet#
read_parquet(path[, engine, columns, ...])
Load a parquet object from the file path, returning a DataFrame.
DataFrame.to_parquet([path, engine, ...])
Write a DataFrame to the binary parquet format.
ORC#
read_orc(path[, columns])
Load an ORC object from the file path, returning a DataFrame.
DataFrame.to_orc([path, engine, index, ...])
Write a DataFrame to the ORC format.
SAS#
read_sas(filepath_or_buffer, *[, format, ...])
Read SAS files stored as either XPORT or SAS7BDAT format files.
SPSS#
read_spss(path[, usecols, convert_categoricals])
Load an SPSS file from the file path, returning a DataFrame.
SQL#
read_sql_table(table_name, con[, schema, ...])
Read SQL database table into a DataFrame.
read_sql_query(sql, con[, index_col, ...])
Read SQL query into a DataFrame.
read_sql(sql, con[, index_col, ...])
Read SQL query or database table into a DataFrame.
DataFrame.to_sql(name, con[, schema, ...])
Write records stored in a DataFrame to a SQL database.
Google BigQuery#
read_gbq(query[, project_id, index_col, ...])
Load data from Google BigQuery.
STATA#
read_stata(filepath_or_buffer, *[, ...])
Read Stata file into DataFrame.
DataFrame.to_stata(path, *[, convert_dates, ...])
Export DataFrame object to Stata dta format.
StataReader.data_label
Return data label of Stata file.
StataReader.value_labels()
Return a nested dict associating each variable name to its value and label.
StataReader.variable_labels()
Return a dict associating each variable name with corresponding label.
StataWriter.write_file()
Export DataFrame object to Stata dta format.
|
reference/io.html
|
pandas.tseries.offsets.Week.is_month_start
|
`pandas.tseries.offsets.Week.is_month_start`
Return boolean whether a timestamp occurs on the month start.
Examples
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_start(ts)
True
```
|
Week.is_month_start()#
Return boolean whether a timestamp occurs on the month start.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Hour(5)
>>> freq.is_month_start(ts)
True
|
reference/api/pandas.tseries.offsets.Week.is_month_start.html
|
pandas.Timestamp.ceil
|
`pandas.Timestamp.ceil`
Return a new Timestamp ceiled to this resolution.
```
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
```
|
Timestamp.ceil(freq, ambiguous='raise', nonexistent='raise')#
Return a new Timestamp ceiled to this resolution.
Parameters
freqstrFrequency string indicating the ceiling resolution.
ambiguousbool or {‘raise’, ‘NaT’}, default ‘raise’The behavior is as follows:
bool contains flags to determine if time is dst or not (note
that this flag is only applicable for ambiguous fall dst dates).
‘NaT’ will return NaT for an ambiguous time.
‘raise’ will raise an AmbiguousTimeError for an ambiguous time.
nonexistent{‘raise’, ‘shift_forward’, ‘shift_backward, ‘NaT’, timedelta}, default ‘raise’A nonexistent time does not exist in a particular timezone
where clocks moved forward due to DST.
‘shift_forward’ will shift the nonexistent time forward to the
closest existing time.
‘shift_backward’ will shift the nonexistent time backward to the
closest existing time.
‘NaT’ will return NaT where there are nonexistent times.
timedelta objects will shift nonexistent times by the timedelta.
‘raise’ will raise an NonExistentTimeError if there are
nonexistent times.
Raises
ValueError if the freq cannot be converted.
Notes
If the Timestamp has a timezone, ceiling will take place relative to the
local (“wall”) time and re-localized to the same timezone. When ceiling
near daylight savings time, use nonexistent and ambiguous to
control the re-localization behavior.
Examples
Create a timestamp object:
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
A timestamp can be ceiled using multiple frequency units:
>>> ts.ceil(freq='H') # hour
Timestamp('2020-03-14 16:00:00')
>>> ts.ceil(freq='T') # minute
Timestamp('2020-03-14 15:33:00')
>>> ts.ceil(freq='S') # seconds
Timestamp('2020-03-14 15:32:53')
>>> ts.ceil(freq='U') # microseconds
Timestamp('2020-03-14 15:32:52.192549')
freq can also be a multiple of a single unit, like ‘5T’ (i.e. 5 minutes):
>>> ts.ceil(freq='5T')
Timestamp('2020-03-14 15:35:00')
or a combination of multiple units, like ‘1H30T’ (i.e. 1 hour and 30 minutes):
>>> ts.ceil(freq='1H30T')
Timestamp('2020-03-14 16:30:00')
Analogous for pd.NaT:
>>> pd.NaT.ceil()
NaT
When rounding near a daylight savings time transition, use ambiguous or
nonexistent to control how the timestamp should be re-localized.
>>> ts_tz = pd.Timestamp("2021-10-31 01:30:00").tz_localize("Europe/Amsterdam")
>>> ts_tz.ceil("H", ambiguous=False)
Timestamp('2021-10-31 02:00:00+0100', tz='Europe/Amsterdam')
>>> ts_tz.ceil("H", ambiguous=True)
Timestamp('2021-10-31 02:00:00+0200', tz='Europe/Amsterdam')
|
reference/api/pandas.Timestamp.ceil.html
|
pandas.core.groupby.DataFrameGroupBy.boxplot
|
`pandas.core.groupby.DataFrameGroupBy.boxplot`
Make box plots from DataFrameGroupBy data.
```
>>> import itertools
>>> tuples = [t for t in itertools.product(range(1000), range(4))]
>>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1'])
>>> data = np.random.randn(len(index),4)
>>> df = pd.DataFrame(data, columns=list('ABCD'), index=index)
>>> grouped = df.groupby(level='lvl1')
>>> grouped.boxplot(rot=45, fontsize=12, figsize=(8,10))
```
|
DataFrameGroupBy.boxplot(subplots=True, column=None, fontsize=None, rot=0, grid=True, ax=None, figsize=None, layout=None, sharex=False, sharey=True, backend=None, **kwargs)[source]#
Make box plots from DataFrameGroupBy data.
Parameters
groupedGrouped DataFrame
subplotsbool
False - no subplots will be used
True - create a subplot for each group.
columncolumn name or list of names, or vectorCan be any valid input to groupby.
fontsizeint or str
rotlabel rotation angle
gridSetting this to True will show the grid
axMatplotlib axis object, default None
figsizeA tuple (width, height) in inches
layouttuple (optional)The layout of the plot: (rows, columns).
sharexbool, default FalseWhether x-axes will be shared among subplots.
shareybool, default TrueWhether y-axes will be shared among subplots.
backendstr, default NoneBackend to use instead of the backend specified in the option
plotting.backend. For instance, ‘matplotlib’. Alternatively, to
specify the plotting.backend for the whole session, set
pd.options.plotting.backend.
New in version 1.0.0.
**kwargsAll other plotting keyword arguments to be passed to
matplotlib’s boxplot function.
Returns
dict of key/value = group key/DataFrame.boxplot return value
or DataFrame.boxplot return value in case subplots=figures=False
Examples
You can create boxplots for grouped data and show them as separate subplots:
>>> import itertools
>>> tuples = [t for t in itertools.product(range(1000), range(4))]
>>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1'])
>>> data = np.random.randn(len(index),4)
>>> df = pd.DataFrame(data, columns=list('ABCD'), index=index)
>>> grouped = df.groupby(level='lvl1')
>>> grouped.boxplot(rot=45, fontsize=12, figsize=(8,10))
The subplots=False option shows the boxplots in a single figure.
>>> grouped.boxplot(subplots=False, rot=45, fontsize=12)
|
reference/api/pandas.core.groupby.DataFrameGroupBy.boxplot.html
|
pandas.Series.abs
|
`pandas.Series.abs`
Return a Series/DataFrame with absolute numeric value of each element.
```
>>> s = pd.Series([-1.10, 2, -3.33, 4])
>>> s.abs()
0 1.10
1 2.00
2 3.33
3 4.00
dtype: float64
```
|
Series.abs()[source]#
Return a Series/DataFrame with absolute numeric value of each element.
This function only applies to elements that are all numeric.
Returns
absSeries/DataFrame containing the absolute value of each element.
See also
numpy.absoluteCalculate the absolute value element-wise.
Notes
For complex inputs, 1.2 + 1j, the absolute value is
\(\sqrt{ a^2 + b^2 }\).
Examples
Absolute numeric values in a Series.
>>> s = pd.Series([-1.10, 2, -3.33, 4])
>>> s.abs()
0 1.10
1 2.00
2 3.33
3 4.00
dtype: float64
Absolute numeric values in a Series with complex numbers.
>>> s = pd.Series([1.2 + 1j])
>>> s.abs()
0 1.56205
dtype: float64
Absolute numeric values in a Series with a Timedelta element.
>>> s = pd.Series([pd.Timedelta('1 days')])
>>> s.abs()
0 1 days
dtype: timedelta64[ns]
Select rows with data closest to certain value using argsort (from
StackOverflow).
>>> df = pd.DataFrame({
... 'a': [4, 5, 6, 7],
... 'b': [10, 20, 30, 40],
... 'c': [100, 50, -30, -50]
... })
>>> df
a b c
0 4 10 100
1 5 20 50
2 6 30 -30
3 7 40 -50
>>> df.loc[(df.c - 43).abs().argsort()]
a b c
1 5 20 50
0 4 10 100
2 6 30 -30
3 7 40 -50
|
reference/api/pandas.Series.abs.html
|
pandas.tseries.offsets.CustomBusinessMonthEnd.m_offset
|
pandas.tseries.offsets.CustomBusinessMonthEnd.m_offset
|
CustomBusinessMonthEnd.m_offset#
|
reference/api/pandas.tseries.offsets.CustomBusinessMonthEnd.m_offset.html
|
pandas documentation
|
pandas documentation
|
Date: Jan 19, 2023 Version: 1.5.3
Download documentation: Zipped HTML
Previous versions: Documentation of previous pandas versions is available at
pandas.pydata.org.
Useful links:
Binary Installers |
Source Repository |
Issues & Ideas |
Q&A Support |
Mailing List
pandas is an open source, BSD-licensed library providing high-performance,
easy-to-use data structures and data analysis tools for the Python
programming language.
Getting started
New to pandas? Check out the getting started guides. They contain an
introduction to pandas’ main concepts and links to additional tutorials.
To the getting started guides
User guide
The user guide provides in-depth information on the
key concepts of pandas with useful background information and explanation.
To the user guide
API reference
The reference guide contains a detailed description of
the pandas API. The reference describes how the methods work and which parameters can
be used. It assumes that you have an understanding of the key concepts.
To the reference guide
Developer guide
Saw a typo in the documentation? Want to improve
existing functionalities? The contributing guidelines will guide
you through the process of improving pandas.
To the development guide
|
index.html
|
pandas.Series.str.cat
|
`pandas.Series.str.cat`
Concatenate strings in the Series/Index with given separator.
If others is specified, this function concatenates the Series/Index
and elements of others element-wise.
If others is not passed, then all values in the Series/Index are
concatenated into a single string with a given sep.
```
>>> s = pd.Series(['a', 'b', np.nan, 'd'])
>>> s.str.cat(sep=' ')
'a b d'
```
|
Series.str.cat(others=None, sep=None, na_rep=None, join='left')[source]#
Concatenate strings in the Series/Index with given separator.
If others is specified, this function concatenates the Series/Index
and elements of others element-wise.
If others is not passed, then all values in the Series/Index are
concatenated into a single string with a given sep.
Parameters
othersSeries, Index, DataFrame, np.ndarray or list-likeSeries, Index, DataFrame, np.ndarray (one- or two-dimensional) and
other list-likes of strings must have the same length as the
calling Series/Index, with the exception of indexed objects (i.e.
Series/Index/DataFrame) if join is not None.
If others is a list-like that contains a combination of Series,
Index or np.ndarray (1-dim), then all elements will be unpacked and
must satisfy the above criteria individually.
If others is None, the method returns the concatenation of all
strings in the calling Series/Index.
sepstr, default ‘’The separator between the different elements/columns. By default
the empty string ‘’ is used.
na_repstr or None, default NoneRepresentation that is inserted for all missing values:
If na_rep is None, and others is None, missing values in the
Series/Index are omitted from the result.
If na_rep is None, and others is not None, a row containing a
missing value in any of the columns (before concatenation) will
have a missing value in the result.
join{‘left’, ‘right’, ‘outer’, ‘inner’}, default ‘left’Determines the join-style between the calling Series/Index and any
Series/Index/DataFrame in others (objects without an index need
to match the length of the calling Series/Index). To disable
alignment, use .values on any Series/Index/DataFrame in others.
New in version 0.23.0.
Changed in version 1.0.0: Changed default of join from None to ‘left’.
Returns
str, Series or IndexIf others is None, str is returned, otherwise a Series/Index
(same type as caller) of objects is returned.
See also
splitSplit each string in the Series/Index.
joinJoin lists contained as elements in the Series/Index.
Examples
When not passing others, all values are concatenated into a single
string:
>>> s = pd.Series(['a', 'b', np.nan, 'd'])
>>> s.str.cat(sep=' ')
'a b d'
By default, NA values in the Series are ignored. Using na_rep, they
can be given a representation:
>>> s.str.cat(sep=' ', na_rep='?')
'a b ? d'
If others is specified, corresponding values are concatenated with
the separator. Result will be a Series of strings.
>>> s.str.cat(['A', 'B', 'C', 'D'], sep=',')
0 a,A
1 b,B
2 NaN
3 d,D
dtype: object
Missing values will remain missing in the result, but can again be
represented using na_rep
>>> s.str.cat(['A', 'B', 'C', 'D'], sep=',', na_rep='-')
0 a,A
1 b,B
2 -,C
3 d,D
dtype: object
If sep is not specified, the values are concatenated without
separation.
>>> s.str.cat(['A', 'B', 'C', 'D'], na_rep='-')
0 aA
1 bB
2 -C
3 dD
dtype: object
Series with different indexes can be aligned before concatenation. The
join-keyword works as in other methods.
>>> t = pd.Series(['d', 'a', 'e', 'c'], index=[3, 0, 4, 2])
>>> s.str.cat(t, join='left', na_rep='-')
0 aa
1 b-
2 -c
3 dd
dtype: object
>>>
>>> s.str.cat(t, join='outer', na_rep='-')
0 aa
1 b-
2 -c
3 dd
4 -e
dtype: object
>>>
>>> s.str.cat(t, join='inner', na_rep='-')
0 aa
2 -c
3 dd
dtype: object
>>>
>>> s.str.cat(t, join='right', na_rep='-')
3 dd
0 aa
4 -e
2 -c
dtype: object
For more examples, see here.
|
reference/api/pandas.Series.str.cat.html
|
pandas.CategoricalIndex.rename_categories
|
`pandas.CategoricalIndex.rename_categories`
Rename categories.
```
>>> c = pd.Categorical(['a', 'a', 'b'])
>>> c.rename_categories([0, 1])
[0, 0, 1]
Categories (2, int64): [0, 1]
```
|
CategoricalIndex.rename_categories(*args, **kwargs)[source]#
Rename categories.
Parameters
new_categorieslist-like, dict-like or callableNew categories which will replace old categories.
list-like: all items must be unique and the number of items in
the new categories must match the existing number of categories.
dict-like: specifies a mapping from
old categories to new. Categories not contained in the mapping
are passed through and extra categories in the mapping are
ignored.
callable : a callable that is called on all items in the old
categories and whose return values comprise the new categories.
inplacebool, default FalseWhether or not to rename the categories inplace or return a copy of
this categorical with renamed categories.
Deprecated since version 1.3.0.
Returns
catCategorical or NoneCategorical with removed categories or None if inplace=True.
Raises
ValueErrorIf new categories are list-like and do not have the same number of
items than the current categories or do not validate as categories
See also
reorder_categoriesReorder categories.
add_categoriesAdd new categories.
remove_categoriesRemove the specified categories.
remove_unused_categoriesRemove categories which are not used.
set_categoriesSet the categories to the specified ones.
Examples
>>> c = pd.Categorical(['a', 'a', 'b'])
>>> c.rename_categories([0, 1])
[0, 0, 1]
Categories (2, int64): [0, 1]
For dict-like new_categories, extra keys are ignored and
categories not in the dictionary are passed through
>>> c.rename_categories({'a': 'A', 'c': 'C'})
['A', 'A', 'b']
Categories (2, object): ['A', 'b']
You may also provide a callable to create the new categories
>>> c.rename_categories(lambda x: x.upper())
['A', 'A', 'B']
Categories (2, object): ['A', 'B']
|
reference/api/pandas.CategoricalIndex.rename_categories.html
|
pandas.notna
|
`pandas.notna`
Detect non-missing values for an array-like object.
```
>>> pd.notna('dog')
True
```
|
pandas.notna(obj)[source]#
Detect non-missing values for an array-like object.
This function takes a scalar or array-like object and indicates
whether values are valid (not missing, which is NaN in numeric
arrays, None or NaN in object arrays, NaT in datetimelike).
Parameters
objarray-like or object valueObject to check for not null or non-missing values.
Returns
bool or array-like of boolFor scalar input, returns a scalar boolean.
For array input, returns an array of boolean indicating whether each
corresponding element is valid.
See also
isnaBoolean inverse of pandas.notna.
Series.notnaDetect valid values in a Series.
DataFrame.notnaDetect valid values in a DataFrame.
Index.notnaDetect valid values in an Index.
Examples
Scalar arguments (including strings) result in a scalar boolean.
>>> pd.notna('dog')
True
>>> pd.notna(pd.NA)
False
>>> pd.notna(np.nan)
False
ndarrays result in an ndarray of booleans.
>>> array = np.array([[1, np.nan, 3], [4, 5, np.nan]])
>>> array
array([[ 1., nan, 3.],
[ 4., 5., nan]])
>>> pd.notna(array)
array([[ True, False, True],
[ True, True, False]])
For indexes, an ndarray of booleans is returned.
>>> index = pd.DatetimeIndex(["2017-07-05", "2017-07-06", None,
... "2017-07-08"])
>>> index
DatetimeIndex(['2017-07-05', '2017-07-06', 'NaT', '2017-07-08'],
dtype='datetime64[ns]', freq=None)
>>> pd.notna(index)
array([ True, True, False, True])
For Series and DataFrame, the same type is returned, containing booleans.
>>> df = pd.DataFrame([['ant', 'bee', 'cat'], ['dog', None, 'fly']])
>>> df
0 1 2
0 ant bee cat
1 dog None fly
>>> pd.notna(df)
0 1 2
0 True True True
1 True False True
>>> pd.notna(df[1])
0 True
1 False
Name: 1, dtype: bool
|
reference/api/pandas.notna.html
|
pandas.IntervalIndex.get_indexer
|
`pandas.IntervalIndex.get_indexer`
Compute indexer and mask for new index given the current index.
```
>>> index = pd.Index(['c', 'a', 'b'])
>>> index.get_indexer(['a', 'b', 'x'])
array([ 1, 2, -1])
```
|
IntervalIndex.get_indexer(target, method=None, limit=None, tolerance=None)[source]#
Compute indexer and mask for new index given the current index.
The indexer should be then used as an input to ndarray.take to align the
current data to the new index.
Parameters
targetIndex
method{None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional
default: exact matches only.
pad / ffill: find the PREVIOUS index value if no exact match.
backfill / bfill: use NEXT index value if no exact match
nearest: use the NEAREST index value if no exact match. Tied
distances are broken by preferring the larger index value.
limitint, optionalMaximum number of consecutive labels in target to match for
inexact matches.
toleranceoptionalMaximum distance between original and new labels for inexact
matches. The values of the index at the matching locations must
satisfy the equation abs(index[indexer] - target) <= tolerance.
Tolerance may be a scalar value, which applies the same tolerance
to all values, or list-like, which applies variable tolerance per
element. List-like includes list, tuple, array, Series, and must be
the same size as the index and its dtype must exactly match the
index’s type.
Returns
indexernp.ndarray[np.intp]Integers from 0 to n - 1 indicating that the index at these
positions matches the corresponding target values. Missing values
in the target are marked by -1.
Notes
Returns -1 for unmatched values, for further explanation see the
example below.
Examples
>>> index = pd.Index(['c', 'a', 'b'])
>>> index.get_indexer(['a', 'b', 'x'])
array([ 1, 2, -1])
Notice that the return value is an array of locations in index
and x is marked by -1, as it is not in index.
|
reference/api/pandas.IntervalIndex.get_indexer.html
|
DataFrame
|
Constructor#
DataFrame([data, index, columns, dtype, copy])
Two-dimensional, size-mutable, potentially heterogeneous tabular data.
Attributes and underlying data#
Axes
DataFrame.index
The index (row labels) of the DataFrame.
DataFrame.columns
The column labels of the DataFrame.
DataFrame.dtypes
Return the dtypes in the DataFrame.
DataFrame.info([verbose, buf, max_cols, ...])
Print a concise summary of a DataFrame.
DataFrame.select_dtypes([include, exclude])
Return a subset of the DataFrame's columns based on the column dtypes.
DataFrame.values
Return a Numpy representation of the DataFrame.
DataFrame.axes
Return a list representing the axes of the DataFrame.
DataFrame.ndim
Return an int representing the number of axes / array dimensions.
DataFrame.size
Return an int representing the number of elements in this object.
DataFrame.shape
Return a tuple representing the dimensionality of the DataFrame.
DataFrame.memory_usage([index, deep])
Return the memory usage of each column in bytes.
DataFrame.empty
Indicator whether Series/DataFrame is empty.
DataFrame.set_flags(*[, copy, ...])
Return a new object with updated flags.
Conversion#
DataFrame.astype(dtype[, copy, errors])
Cast a pandas object to a specified dtype dtype.
DataFrame.convert_dtypes([infer_objects, ...])
Convert columns to best possible dtypes using dtypes supporting pd.NA.
DataFrame.infer_objects()
Attempt to infer better dtypes for object columns.
DataFrame.copy([deep])
Make a copy of this object's indices and data.
DataFrame.bool()
Return the bool of a single element Series or DataFrame.
Indexing, iteration#
DataFrame.head([n])
Return the first n rows.
DataFrame.at
Access a single value for a row/column label pair.
DataFrame.iat
Access a single value for a row/column pair by integer position.
DataFrame.loc
Access a group of rows and columns by label(s) or a boolean array.
DataFrame.iloc
Purely integer-location based indexing for selection by position.
DataFrame.insert(loc, column, value[, ...])
Insert column into DataFrame at specified location.
DataFrame.__iter__()
Iterate over info axis.
DataFrame.items()
Iterate over (column name, Series) pairs.
DataFrame.iteritems()
(DEPRECATED) Iterate over (column name, Series) pairs.
DataFrame.keys()
Get the 'info axis' (see Indexing for more).
DataFrame.iterrows()
Iterate over DataFrame rows as (index, Series) pairs.
DataFrame.itertuples([index, name])
Iterate over DataFrame rows as namedtuples.
DataFrame.lookup(row_labels, col_labels)
(DEPRECATED) Label-based "fancy indexing" function for DataFrame.
DataFrame.pop(item)
Return item and drop from frame.
DataFrame.tail([n])
Return the last n rows.
DataFrame.xs(key[, axis, level, drop_level])
Return cross-section from the Series/DataFrame.
DataFrame.get(key[, default])
Get item from object for given key (ex: DataFrame column).
DataFrame.isin(values)
Whether each element in the DataFrame is contained in values.
DataFrame.where(cond[, other, inplace, ...])
Replace values where the condition is False.
DataFrame.mask(cond[, other, inplace, axis, ...])
Replace values where the condition is True.
DataFrame.query(expr, *[, inplace])
Query the columns of a DataFrame with a boolean expression.
For more information on .at, .iat, .loc, and
.iloc, see the indexing documentation.
Binary operator functions#
DataFrame.add(other[, axis, level, fill_value])
Get Addition of dataframe and other, element-wise (binary operator add).
DataFrame.sub(other[, axis, level, fill_value])
Get Subtraction of dataframe and other, element-wise (binary operator sub).
DataFrame.mul(other[, axis, level, fill_value])
Get Multiplication of dataframe and other, element-wise (binary operator mul).
DataFrame.div(other[, axis, level, fill_value])
Get Floating division of dataframe and other, element-wise (binary operator truediv).
DataFrame.truediv(other[, axis, level, ...])
Get Floating division of dataframe and other, element-wise (binary operator truediv).
DataFrame.floordiv(other[, axis, level, ...])
Get Integer division of dataframe and other, element-wise (binary operator floordiv).
DataFrame.mod(other[, axis, level, fill_value])
Get Modulo of dataframe and other, element-wise (binary operator mod).
DataFrame.pow(other[, axis, level, fill_value])
Get Exponential power of dataframe and other, element-wise (binary operator pow).
DataFrame.dot(other)
Compute the matrix multiplication between the DataFrame and other.
DataFrame.radd(other[, axis, level, fill_value])
Get Addition of dataframe and other, element-wise (binary operator radd).
DataFrame.rsub(other[, axis, level, fill_value])
Get Subtraction of dataframe and other, element-wise (binary operator rsub).
DataFrame.rmul(other[, axis, level, fill_value])
Get Multiplication of dataframe and other, element-wise (binary operator rmul).
DataFrame.rdiv(other[, axis, level, fill_value])
Get Floating division of dataframe and other, element-wise (binary operator rtruediv).
DataFrame.rtruediv(other[, axis, level, ...])
Get Floating division of dataframe and other, element-wise (binary operator rtruediv).
DataFrame.rfloordiv(other[, axis, level, ...])
Get Integer division of dataframe and other, element-wise (binary operator rfloordiv).
DataFrame.rmod(other[, axis, level, fill_value])
Get Modulo of dataframe and other, element-wise (binary operator rmod).
DataFrame.rpow(other[, axis, level, fill_value])
Get Exponential power of dataframe and other, element-wise (binary operator rpow).
DataFrame.lt(other[, axis, level])
Get Less than of dataframe and other, element-wise (binary operator lt).
DataFrame.gt(other[, axis, level])
Get Greater than of dataframe and other, element-wise (binary operator gt).
DataFrame.le(other[, axis, level])
Get Less than or equal to of dataframe and other, element-wise (binary operator le).
DataFrame.ge(other[, axis, level])
Get Greater than or equal to of dataframe and other, element-wise (binary operator ge).
DataFrame.ne(other[, axis, level])
Get Not equal to of dataframe and other, element-wise (binary operator ne).
DataFrame.eq(other[, axis, level])
Get Equal to of dataframe and other, element-wise (binary operator eq).
DataFrame.combine(other, func[, fill_value, ...])
Perform column-wise combine with another DataFrame.
DataFrame.combine_first(other)
Update null elements with value in the same location in other.
Function application, GroupBy & window#
DataFrame.apply(func[, axis, raw, ...])
Apply a function along an axis of the DataFrame.
DataFrame.applymap(func[, na_action])
Apply a function to a Dataframe elementwise.
DataFrame.pipe(func, *args, **kwargs)
Apply chainable functions that expect Series or DataFrames.
DataFrame.agg([func, axis])
Aggregate using one or more operations over the specified axis.
DataFrame.aggregate([func, axis])
Aggregate using one or more operations over the specified axis.
DataFrame.transform(func[, axis])
Call func on self producing a DataFrame with the same axis shape as self.
DataFrame.groupby([by, axis, level, ...])
Group DataFrame using a mapper or by a Series of columns.
DataFrame.rolling(window[, min_periods, ...])
Provide rolling window calculations.
DataFrame.expanding([min_periods, center, ...])
Provide expanding window calculations.
DataFrame.ewm([com, span, halflife, alpha, ...])
Provide exponentially weighted (EW) calculations.
Computations / descriptive stats#
DataFrame.abs()
Return a Series/DataFrame with absolute numeric value of each element.
DataFrame.all([axis, bool_only, skipna, level])
Return whether all elements are True, potentially over an axis.
DataFrame.any(*[, axis, bool_only, skipna, ...])
Return whether any element is True, potentially over an axis.
DataFrame.clip([lower, upper, axis, inplace])
Trim values at input threshold(s).
DataFrame.corr([method, min_periods, ...])
Compute pairwise correlation of columns, excluding NA/null values.
DataFrame.corrwith(other[, axis, drop, ...])
Compute pairwise correlation.
DataFrame.count([axis, level, numeric_only])
Count non-NA cells for each column or row.
DataFrame.cov([min_periods, ddof, numeric_only])
Compute pairwise covariance of columns, excluding NA/null values.
DataFrame.cummax([axis, skipna])
Return cumulative maximum over a DataFrame or Series axis.
DataFrame.cummin([axis, skipna])
Return cumulative minimum over a DataFrame or Series axis.
DataFrame.cumprod([axis, skipna])
Return cumulative product over a DataFrame or Series axis.
DataFrame.cumsum([axis, skipna])
Return cumulative sum over a DataFrame or Series axis.
DataFrame.describe([percentiles, include, ...])
Generate descriptive statistics.
DataFrame.diff([periods, axis])
First discrete difference of element.
DataFrame.eval(expr, *[, inplace])
Evaluate a string describing operations on DataFrame columns.
DataFrame.kurt([axis, skipna, level, ...])
Return unbiased kurtosis over requested axis.
DataFrame.kurtosis([axis, skipna, level, ...])
Return unbiased kurtosis over requested axis.
DataFrame.mad([axis, skipna, level])
(DEPRECATED) Return the mean absolute deviation of the values over the requested axis.
DataFrame.max([axis, skipna, level, ...])
Return the maximum of the values over the requested axis.
DataFrame.mean([axis, skipna, level, ...])
Return the mean of the values over the requested axis.
DataFrame.median([axis, skipna, level, ...])
Return the median of the values over the requested axis.
DataFrame.min([axis, skipna, level, ...])
Return the minimum of the values over the requested axis.
DataFrame.mode([axis, numeric_only, dropna])
Get the mode(s) of each element along the selected axis.
DataFrame.pct_change([periods, fill_method, ...])
Percentage change between the current and a prior element.
DataFrame.prod([axis, skipna, level, ...])
Return the product of the values over the requested axis.
DataFrame.product([axis, skipna, level, ...])
Return the product of the values over the requested axis.
DataFrame.quantile([q, axis, numeric_only, ...])
Return values at the given quantile over requested axis.
DataFrame.rank([axis, method, numeric_only, ...])
Compute numerical data ranks (1 through n) along axis.
DataFrame.round([decimals])
Round a DataFrame to a variable number of decimal places.
DataFrame.sem([axis, skipna, level, ddof, ...])
Return unbiased standard error of the mean over requested axis.
DataFrame.skew([axis, skipna, level, ...])
Return unbiased skew over requested axis.
DataFrame.sum([axis, skipna, level, ...])
Return the sum of the values over the requested axis.
DataFrame.std([axis, skipna, level, ddof, ...])
Return sample standard deviation over requested axis.
DataFrame.var([axis, skipna, level, ddof, ...])
Return unbiased variance over requested axis.
DataFrame.nunique([axis, dropna])
Count number of distinct elements in specified axis.
DataFrame.value_counts([subset, normalize, ...])
Return a Series containing counts of unique rows in the DataFrame.
Reindexing / selection / label manipulation#
DataFrame.add_prefix(prefix)
Prefix labels with string prefix.
DataFrame.add_suffix(suffix)
Suffix labels with string suffix.
DataFrame.align(other[, join, axis, level, ...])
Align two objects on their axes with the specified join method.
DataFrame.at_time(time[, asof, axis])
Select values at particular time of day (e.g., 9:30AM).
DataFrame.between_time(start_time, end_time)
Select values between particular times of the day (e.g., 9:00-9:30 AM).
DataFrame.drop([labels, axis, index, ...])
Drop specified labels from rows or columns.
DataFrame.drop_duplicates([subset, keep, ...])
Return DataFrame with duplicate rows removed.
DataFrame.duplicated([subset, keep])
Return boolean Series denoting duplicate rows.
DataFrame.equals(other)
Test whether two objects contain the same elements.
DataFrame.filter([items, like, regex, axis])
Subset the dataframe rows or columns according to the specified index labels.
DataFrame.first(offset)
Select initial periods of time series data based on a date offset.
DataFrame.head([n])
Return the first n rows.
DataFrame.idxmax([axis, skipna, numeric_only])
Return index of first occurrence of maximum over requested axis.
DataFrame.idxmin([axis, skipna, numeric_only])
Return index of first occurrence of minimum over requested axis.
DataFrame.last(offset)
Select final periods of time series data based on a date offset.
DataFrame.reindex([labels, index, columns, ...])
Conform Series/DataFrame to new index with optional filling logic.
DataFrame.reindex_like(other[, method, ...])
Return an object with matching indices as other object.
DataFrame.rename([mapper, index, columns, ...])
Alter axes labels.
DataFrame.rename_axis([mapper, inplace])
Set the name of the axis for the index or columns.
DataFrame.reset_index([level, drop, ...])
Reset the index, or a level of it.
DataFrame.sample([n, frac, replace, ...])
Return a random sample of items from an axis of object.
DataFrame.set_axis(labels, *[, axis, ...])
Assign desired index to given axis.
DataFrame.set_index(keys, *[, drop, append, ...])
Set the DataFrame index using existing columns.
DataFrame.tail([n])
Return the last n rows.
DataFrame.take(indices[, axis, is_copy])
Return the elements in the given positional indices along an axis.
DataFrame.truncate([before, after, axis, copy])
Truncate a Series or DataFrame before and after some index value.
Missing data handling#
DataFrame.backfill(*[, axis, inplace, ...])
Synonym for DataFrame.fillna() with method='bfill'.
DataFrame.bfill(*[, axis, inplace, limit, ...])
Synonym for DataFrame.fillna() with method='bfill'.
DataFrame.dropna(*[, axis, how, thresh, ...])
Remove missing values.
DataFrame.ffill(*[, axis, inplace, limit, ...])
Synonym for DataFrame.fillna() with method='ffill'.
DataFrame.fillna([value, method, axis, ...])
Fill NA/NaN values using the specified method.
DataFrame.interpolate([method, axis, limit, ...])
Fill NaN values using an interpolation method.
DataFrame.isna()
Detect missing values.
DataFrame.isnull()
DataFrame.isnull is an alias for DataFrame.isna.
DataFrame.notna()
Detect existing (non-missing) values.
DataFrame.notnull()
DataFrame.notnull is an alias for DataFrame.notna.
DataFrame.pad(*[, axis, inplace, limit, ...])
Synonym for DataFrame.fillna() with method='ffill'.
DataFrame.replace([to_replace, value, ...])
Replace values given in to_replace with value.
Reshaping, sorting, transposing#
DataFrame.droplevel(level[, axis])
Return Series/DataFrame with requested index / column level(s) removed.
DataFrame.pivot(*[, index, columns, values])
Return reshaped DataFrame organized by given index / column values.
DataFrame.pivot_table([values, index, ...])
Create a spreadsheet-style pivot table as a DataFrame.
DataFrame.reorder_levels(order[, axis])
Rearrange index levels using input order.
DataFrame.sort_values(by, *[, axis, ...])
Sort by the values along either axis.
DataFrame.sort_index(*[, axis, level, ...])
Sort object by labels (along an axis).
DataFrame.nlargest(n, columns[, keep])
Return the first n rows ordered by columns in descending order.
DataFrame.nsmallest(n, columns[, keep])
Return the first n rows ordered by columns in ascending order.
DataFrame.swaplevel([i, j, axis])
Swap levels i and j in a MultiIndex.
DataFrame.stack([level, dropna])
Stack the prescribed level(s) from columns to index.
DataFrame.unstack([level, fill_value])
Pivot a level of the (necessarily hierarchical) index labels.
DataFrame.swapaxes(axis1, axis2[, copy])
Interchange axes and swap values axes appropriately.
DataFrame.melt([id_vars, value_vars, ...])
Unpivot a DataFrame from wide to long format, optionally leaving identifiers set.
DataFrame.explode(column[, ignore_index])
Transform each element of a list-like to a row, replicating index values.
DataFrame.squeeze([axis])
Squeeze 1 dimensional axis objects into scalars.
DataFrame.to_xarray()
Return an xarray object from the pandas object.
DataFrame.T
DataFrame.transpose(*args[, copy])
Transpose index and columns.
Combining / comparing / joining / merging#
DataFrame.append(other[, ignore_index, ...])
(DEPRECATED) Append rows of other to the end of caller, returning a new object.
DataFrame.assign(**kwargs)
Assign new columns to a DataFrame.
DataFrame.compare(other[, align_axis, ...])
Compare to another DataFrame and show the differences.
DataFrame.join(other[, on, how, lsuffix, ...])
Join columns of another DataFrame.
DataFrame.merge(right[, how, on, left_on, ...])
Merge DataFrame or named Series objects with a database-style join.
DataFrame.update(other[, join, overwrite, ...])
Modify in place using non-NA values from another DataFrame.
Time Series-related#
DataFrame.asfreq(freq[, method, how, ...])
Convert time series to specified frequency.
DataFrame.asof(where[, subset])
Return the last row(s) without any NaNs before where.
DataFrame.shift([periods, freq, axis, ...])
Shift index by desired number of periods with an optional time freq.
DataFrame.slice_shift([periods, axis])
(DEPRECATED) Equivalent to shift without copying data.
DataFrame.tshift([periods, freq, axis])
(DEPRECATED) Shift the time index, using the index's frequency if available.
DataFrame.first_valid_index()
Return index for first non-NA value or None, if no non-NA value is found.
DataFrame.last_valid_index()
Return index for last non-NA value or None, if no non-NA value is found.
DataFrame.resample(rule[, axis, closed, ...])
Resample time-series data.
DataFrame.to_period([freq, axis, copy])
Convert DataFrame from DatetimeIndex to PeriodIndex.
DataFrame.to_timestamp([freq, how, axis, copy])
Cast to DatetimeIndex of timestamps, at beginning of period.
DataFrame.tz_convert(tz[, axis, level, copy])
Convert tz-aware axis to target time zone.
DataFrame.tz_localize(tz[, axis, level, ...])
Localize tz-naive index of a Series or DataFrame to target time zone.
Flags#
Flags refer to attributes of the pandas object. Properties of the dataset (like
the date is was recorded, the URL it was accessed from, etc.) should be stored
in DataFrame.attrs.
Flags(obj, *, allows_duplicate_labels)
Flags that apply to pandas objects.
Metadata#
DataFrame.attrs is a dictionary for storing global metadata for this DataFrame.
Warning
DataFrame.attrs is considered experimental and may change without warning.
DataFrame.attrs
Dictionary of global attributes of this dataset.
Plotting#
DataFrame.plot is both a callable method and a namespace attribute for
specific plotting methods of the form DataFrame.plot.<kind>.
DataFrame.plot([x, y, kind, ax, ....])
DataFrame plotting accessor and method
DataFrame.plot.area([x, y])
Draw a stacked area plot.
DataFrame.plot.bar([x, y])
Vertical bar plot.
DataFrame.plot.barh([x, y])
Make a horizontal bar plot.
DataFrame.plot.box([by])
Make a box plot of the DataFrame columns.
DataFrame.plot.density([bw_method, ind])
Generate Kernel Density Estimate plot using Gaussian kernels.
DataFrame.plot.hexbin(x, y[, C, ...])
Generate a hexagonal binning plot.
DataFrame.plot.hist([by, bins])
Draw one histogram of the DataFrame's columns.
DataFrame.plot.kde([bw_method, ind])
Generate Kernel Density Estimate plot using Gaussian kernels.
DataFrame.plot.line([x, y])
Plot Series or DataFrame as lines.
DataFrame.plot.pie(**kwargs)
Generate a pie plot.
DataFrame.plot.scatter(x, y[, s, c])
Create a scatter plot with varying marker point size and color.
DataFrame.boxplot([column, by, ax, ...])
Make a box plot from DataFrame columns.
DataFrame.hist([column, by, grid, ...])
Make a histogram of the DataFrame's columns.
Sparse accessor#
Sparse-dtype specific methods and attributes are provided under the
DataFrame.sparse accessor.
DataFrame.sparse.density
Ratio of non-sparse points to total (dense) data points.
DataFrame.sparse.from_spmatrix(data[, ...])
Create a new DataFrame from a scipy sparse matrix.
DataFrame.sparse.to_coo()
Return the contents of the frame as a sparse SciPy COO matrix.
DataFrame.sparse.to_dense()
Convert a DataFrame with sparse values to dense.
Serialization / IO / conversion#
DataFrame.from_dict(data[, orient, dtype, ...])
Construct DataFrame from dict of array-like or dicts.
DataFrame.from_records(data[, index, ...])
Convert structured or record ndarray to DataFrame.
DataFrame.to_orc([path, engine, index, ...])
Write a DataFrame to the ORC format.
DataFrame.to_parquet([path, engine, ...])
Write a DataFrame to the binary parquet format.
DataFrame.to_pickle(path[, compression, ...])
Pickle (serialize) object to file.
DataFrame.to_csv([path_or_buf, sep, na_rep, ...])
Write object to a comma-separated values (csv) file.
DataFrame.to_hdf(path_or_buf, key[, mode, ...])
Write the contained data to an HDF5 file using HDFStore.
DataFrame.to_sql(name, con[, schema, ...])
Write records stored in a DataFrame to a SQL database.
DataFrame.to_dict([orient, into])
Convert the DataFrame to a dictionary.
DataFrame.to_excel(excel_writer[, ...])
Write object to an Excel sheet.
DataFrame.to_json([path_or_buf, orient, ...])
Convert the object to a JSON string.
DataFrame.to_html([buf, columns, col_space, ...])
Render a DataFrame as an HTML table.
DataFrame.to_feather(path, **kwargs)
Write a DataFrame to the binary Feather format.
DataFrame.to_latex([buf, columns, ...])
Render object to a LaTeX tabular, longtable, or nested table.
DataFrame.to_stata(path, *[, convert_dates, ...])
Export DataFrame object to Stata dta format.
DataFrame.to_gbq(destination_table[, ...])
Write a DataFrame to a Google BigQuery table.
DataFrame.to_records([index, column_dtypes, ...])
Convert DataFrame to a NumPy record array.
DataFrame.to_string([buf, columns, ...])
Render a DataFrame to a console-friendly tabular output.
DataFrame.to_clipboard([excel, sep])
Copy object to the system clipboard.
DataFrame.to_markdown([buf, mode, index, ...])
Print DataFrame in Markdown-friendly format.
DataFrame.style
Returns a Styler object.
DataFrame.__dataframe__([nan_as_null, ...])
Return the dataframe interchange object implementing the interchange protocol.
|
reference/frame.html
| null |
pandas.Series.cumsum
|
`pandas.Series.cumsum`
Return cumulative sum over a DataFrame or Series axis.
```
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0 2.0
1 NaN
2 5.0
3 -1.0
4 0.0
dtype: float64
```
|
Series.cumsum(axis=None, skipna=True, *args, **kwargs)[source]#
Return cumulative sum over a DataFrame or Series axis.
Returns a DataFrame or Series of the same size containing the cumulative
sum.
Parameters
axis{0 or ‘index’, 1 or ‘columns’}, default 0The index or the name of the axis. 0 is equivalent to None or ‘index’.
For Series this parameter is unused and defaults to 0.
skipnabool, default TrueExclude NA/null values. If an entire row/column is NA, the result
will be NA.
*args, **kwargsAdditional keywords have no effect but might be accepted for
compatibility with NumPy.
Returns
scalar or SeriesReturn cumulative sum of scalar or Series.
See also
core.window.expanding.Expanding.sumSimilar functionality but ignores NaN values.
Series.sumReturn the sum over Series axis.
Series.cummaxReturn cumulative maximum over Series axis.
Series.cumminReturn cumulative minimum over Series axis.
Series.cumsumReturn cumulative sum over Series axis.
Series.cumprodReturn cumulative product over Series axis.
Examples
Series
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0 2.0
1 NaN
2 5.0
3 -1.0
4 0.0
dtype: float64
By default, NA values are ignored.
>>> s.cumsum()
0 2.0
1 NaN
2 7.0
3 6.0
4 6.0
dtype: float64
To include NA values in the operation, use skipna=False
>>> s.cumsum(skipna=False)
0 2.0
1 NaN
2 NaN
3 NaN
4 NaN
dtype: float64
DataFrame
>>> df = pd.DataFrame([[2.0, 1.0],
... [3.0, np.nan],
... [1.0, 0.0]],
... columns=list('AB'))
>>> df
A B
0 2.0 1.0
1 3.0 NaN
2 1.0 0.0
By default, iterates over rows and finds the sum
in each column. This is equivalent to axis=None or axis='index'.
>>> df.cumsum()
A B
0 2.0 1.0
1 5.0 NaN
2 6.0 1.0
To iterate over columns and find the sum in each row,
use axis=1
>>> df.cumsum(axis=1)
A B
0 2.0 3.0
1 3.0 NaN
2 1.0 1.0
|
reference/api/pandas.Series.cumsum.html
|
pandas.read_csv
|
`pandas.read_csv`
Read a comma-separated values (csv) file into DataFrame.
```
>>> pd.read_csv('data.csv')
```
|
pandas.read_csv(filepath_or_buffer, *, sep=_NoDefault.no_default, delimiter=None, header='infer', names=_NoDefault.no_default, index_col=None, usecols=None, squeeze=None, prefix=_NoDefault.no_default, mangle_dupe_cols=True, dtype=None, engine=None, converters=None, true_values=None, false_values=None, skipinitialspace=False, skiprows=None, skipfooter=0, nrows=None, na_values=None, keep_default_na=True, na_filter=True, verbose=False, skip_blank_lines=True, parse_dates=None, infer_datetime_format=False, keep_date_col=False, date_parser=None, dayfirst=False, cache_dates=True, iterator=False, chunksize=None, compression='infer', thousands=None, decimal='.', lineterminator=None, quotechar='"', quoting=0, doublequote=True, escapechar=None, comment=None, encoding=None, encoding_errors='strict', dialect=None, error_bad_lines=None, warn_bad_lines=None, on_bad_lines=None, delim_whitespace=False, low_memory=True, memory_map=False, float_precision=None, storage_options=None)[source]#
Read a comma-separated values (csv) file into DataFrame.
Also supports optionally iterating or breaking of the file
into chunks.
Additional help can be found in the online docs for
IO Tools.
Parameters
filepath_or_bufferstr, path object or file-like objectAny valid string path is acceptable. The string could be a URL. Valid
URL schemes include http, ftp, s3, gs, and file. For file URLs, a host is
expected. A local file could be: file://localhost/path/to/table.csv.
If you want to pass in a path object, pandas accepts any os.PathLike.
By file-like object, we refer to objects with a read() method, such as
a file handle (e.g. via builtin open function) or StringIO.
sepstr, default ‘,’Delimiter to use. If sep is None, the C engine cannot automatically detect
the separator, but the Python parsing engine can, meaning the latter will
be used and automatically detect the separator by Python’s builtin sniffer
tool, csv.Sniffer. In addition, separators longer than 1 character and
different from '\s+' will be interpreted as regular expressions and
will also force the use of the Python parsing engine. Note that regex
delimiters are prone to ignoring quoted data. Regex example: '\r\t'.
delimiterstr, default NoneAlias for sep.
headerint, list of int, None, default ‘infer’Row number(s) to use as the column names, and the start of the
data. Default behavior is to infer the column names: if no names
are passed the behavior is identical to header=0 and column
names are inferred from the first line of the file, if column
names are passed explicitly then the behavior is identical to
header=None. Explicitly pass header=0 to be able to
replace existing names. The header can be a list of integers that
specify row locations for a multi-index on the columns
e.g. [0,1,3]. Intervening rows that are not specified will be
skipped (e.g. 2 in this example is skipped). Note that this
parameter ignores commented lines and empty lines if
skip_blank_lines=True, so header=0 denotes the first line of
data rather than the first line of the file.
namesarray-like, optionalList of column names to use. If the file contains a header row,
then you should explicitly pass header=0 to override the column names.
Duplicates in this list are not allowed.
index_colint, str, sequence of int / str, or False, optional, default NoneColumn(s) to use as the row labels of the DataFrame, either given as
string name or column index. If a sequence of int / str is given, a
MultiIndex is used.
Note: index_col=False can be used to force pandas to not use the first
column as the index, e.g. when you have a malformed file with delimiters at
the end of each line.
usecolslist-like or callable, optionalReturn a subset of the columns. If list-like, all elements must either
be positional (i.e. integer indices into the document columns) or strings
that correspond to column names provided either by the user in names or
inferred from the document header row(s). If names are given, the document
header row(s) are not taken into account. For example, a valid list-like
usecols parameter would be [0, 1, 2] or ['foo', 'bar', 'baz'].
Element order is ignored, so usecols=[0, 1] is the same as [1, 0].
To instantiate a DataFrame from data with element order preserved use
pd.read_csv(data, usecols=['foo', 'bar'])[['foo', 'bar']] for columns
in ['foo', 'bar'] order or
pd.read_csv(data, usecols=['foo', 'bar'])[['bar', 'foo']]
for ['bar', 'foo'] order.
If callable, the callable function will be evaluated against the column
names, returning names where the callable function evaluates to True. An
example of a valid callable argument would be lambda x: x.upper() in
['AAA', 'BBB', 'DDD']. Using this parameter results in much faster
parsing time and lower memory usage.
squeezebool, default FalseIf the parsed data only contains one column then return a Series.
Deprecated since version 1.4.0: Append .squeeze("columns") to the call to read_csv to squeeze
the data.
prefixstr, optionalPrefix to add to column numbers when no header, e.g. ‘X’ for X0, X1, …
Deprecated since version 1.4.0: Use a list comprehension on the DataFrame’s columns after calling read_csv.
mangle_dupe_colsbool, default TrueDuplicate columns will be specified as ‘X’, ‘X.1’, …’X.N’, rather than
‘X’…’X’. Passing in False will cause data to be overwritten if there
are duplicate names in the columns.
Deprecated since version 1.5.0: Not implemented, and a new argument to specify the pattern for the
names of duplicated columns will be added instead
dtypeType name or dict of column -> type, optionalData type for data or columns. E.g. {‘a’: np.float64, ‘b’: np.int32,
‘c’: ‘Int64’}
Use str or object together with suitable na_values settings
to preserve and not interpret dtype.
If converters are specified, they will be applied INSTEAD
of dtype conversion.
New in version 1.5.0: Support for defaultdict was added. Specify a defaultdict as input where
the default determines the dtype of the columns which are not explicitly
listed.
engine{‘c’, ‘python’, ‘pyarrow’}, optionalParser engine to use. The C and pyarrow engines are faster, while the python engine
is currently more feature-complete. Multithreading is currently only supported by
the pyarrow engine.
New in version 1.4.0: The “pyarrow” engine was added as an experimental engine, and some features
are unsupported, or may not work correctly, with this engine.
convertersdict, optionalDict of functions for converting values in certain columns. Keys can either
be integers or column labels.
true_valueslist, optionalValues to consider as True.
false_valueslist, optionalValues to consider as False.
skipinitialspacebool, default FalseSkip spaces after delimiter.
skiprowslist-like, int or callable, optionalLine numbers to skip (0-indexed) or number of lines to skip (int)
at the start of the file.
If callable, the callable function will be evaluated against the row
indices, returning True if the row should be skipped and False otherwise.
An example of a valid callable argument would be lambda x: x in [0, 2].
skipfooterint, default 0Number of lines at bottom of file to skip (Unsupported with engine=’c’).
nrowsint, optionalNumber of rows of file to read. Useful for reading pieces of large files.
na_valuesscalar, str, list-like, or dict, optionalAdditional strings to recognize as NA/NaN. If dict passed, specific
per-column NA values. By default the following values are interpreted as
NaN: ‘’, ‘#N/A’, ‘#N/A N/A’, ‘#NA’, ‘-1.#IND’, ‘-1.#QNAN’, ‘-NaN’, ‘-nan’,
‘1.#IND’, ‘1.#QNAN’, ‘<NA>’, ‘N/A’, ‘NA’, ‘NULL’, ‘NaN’, ‘n/a’,
‘nan’, ‘null’.
keep_default_nabool, default TrueWhether or not to include the default NaN values when parsing the data.
Depending on whether na_values is passed in, the behavior is as follows:
If keep_default_na is True, and na_values are specified, na_values
is appended to the default NaN values used for parsing.
If keep_default_na is True, and na_values are not specified, only
the default NaN values are used for parsing.
If keep_default_na is False, and na_values are specified, only
the NaN values specified na_values are used for parsing.
If keep_default_na is False, and na_values are not specified, no
strings will be parsed as NaN.
Note that if na_filter is passed in as False, the keep_default_na and
na_values parameters will be ignored.
na_filterbool, default TrueDetect missing value markers (empty strings and the value of na_values). In
data without any NAs, passing na_filter=False can improve the performance
of reading a large file.
verbosebool, default FalseIndicate number of NA values placed in non-numeric columns.
skip_blank_linesbool, default TrueIf True, skip over blank lines rather than interpreting as NaN values.
parse_datesbool or list of int or names or list of lists or dict, default FalseThe behavior is as follows:
boolean. If True -> try parsing the index.
list of int or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3
each as a separate date column.
list of lists. e.g. If [[1, 3]] -> combine columns 1 and 3 and parse as
a single date column.
dict, e.g. {‘foo’ : [1, 3]} -> parse columns 1, 3 as date and call
result ‘foo’
If a column or index cannot be represented as an array of datetimes,
say because of an unparsable value or a mixture of timezones, the column
or index will be returned unaltered as an object data type. For
non-standard datetime parsing, use pd.to_datetime after
pd.read_csv. To parse an index or column with a mixture of timezones,
specify date_parser to be a partially-applied
pandas.to_datetime() with utc=True. See
Parsing a CSV with mixed timezones for more.
Note: A fast-path exists for iso8601-formatted dates.
infer_datetime_formatbool, default FalseIf True and parse_dates is enabled, pandas will attempt to infer the
format of the datetime strings in the columns, and if it can be inferred,
switch to a faster method of parsing them. In some cases this can increase
the parsing speed by 5-10x.
keep_date_colbool, default FalseIf True and parse_dates specifies combining multiple columns then
keep the original columns.
date_parserfunction, optionalFunction to use for converting a sequence of string columns to an array of
datetime instances. The default uses dateutil.parser.parser to do the
conversion. Pandas will try to call date_parser in three different ways,
advancing to the next if an exception occurs: 1) Pass one or more arrays
(as defined by parse_dates) as arguments; 2) concatenate (row-wise) the
string values from the columns defined by parse_dates into a single array
and pass that; and 3) call date_parser once for each row using one or
more strings (corresponding to the columns defined by parse_dates) as
arguments.
dayfirstbool, default FalseDD/MM format dates, international and European format.
cache_datesbool, default TrueIf True, use a cache of unique, converted dates to apply the datetime
conversion. May produce significant speed-up when parsing duplicate
date strings, especially ones with timezone offsets.
New in version 0.25.0.
iteratorbool, default FalseReturn TextFileReader object for iteration or getting chunks with
get_chunk().
Changed in version 1.2: TextFileReader is a context manager.
chunksizeint, optionalReturn TextFileReader object for iteration.
See the IO Tools docs
for more information on iterator and chunksize.
Changed in version 1.2: TextFileReader is a context manager.
compressionstr or dict, default ‘infer’For on-the-fly decompression of on-disk data. If ‘infer’ and ‘filepath_or_buffer’ is
path-like, then detect compression from the following extensions: ‘.gz’,
‘.bz2’, ‘.zip’, ‘.xz’, ‘.zst’, ‘.tar’, ‘.tar.gz’, ‘.tar.xz’ or ‘.tar.bz2’
(otherwise no compression).
If using ‘zip’ or ‘tar’, the ZIP file must contain only one data file to be read in.
Set to None for no decompression.
Can also be a dict with key 'method' set
to one of {'zip', 'gzip', 'bz2', 'zstd', 'tar'} and other
key-value pairs are forwarded to
zipfile.ZipFile, gzip.GzipFile,
bz2.BZ2File, zstandard.ZstdDecompressor or
tarfile.TarFile, respectively.
As an example, the following could be passed for Zstandard decompression using a
custom compression dictionary:
compression={'method': 'zstd', 'dict_data': my_compression_dict}.
New in version 1.5.0: Added support for .tar files.
Changed in version 1.4.0: Zstandard support.
thousandsstr, optionalThousands separator.
decimalstr, default ‘.’Character to recognize as decimal point (e.g. use ‘,’ for European data).
lineterminatorstr (length 1), optionalCharacter to break file into lines. Only valid with C parser.
quotecharstr (length 1), optionalThe character used to denote the start and end of a quoted item. Quoted
items can include the delimiter and it will be ignored.
quotingint or csv.QUOTE_* instance, default 0Control field quoting behavior per csv.QUOTE_* constants. Use one of
QUOTE_MINIMAL (0), QUOTE_ALL (1), QUOTE_NONNUMERIC (2) or QUOTE_NONE (3).
doublequotebool, default TrueWhen quotechar is specified and quoting is not QUOTE_NONE, indicate
whether or not to interpret two consecutive quotechar elements INSIDE a
field as a single quotechar element.
escapecharstr (length 1), optionalOne-character string used to escape other characters.
commentstr, optionalIndicates remainder of line should not be parsed. If found at the beginning
of a line, the line will be ignored altogether. This parameter must be a
single character. Like empty lines (as long as skip_blank_lines=True),
fully commented lines are ignored by the parameter header but not by
skiprows. For example, if comment='#', parsing
#empty\na,b,c\n1,2,3 with header=0 will result in ‘a,b,c’ being
treated as the header.
encodingstr, optionalEncoding to use for UTF when reading/writing (ex. ‘utf-8’). List of Python
standard encodings .
Changed in version 1.2: When encoding is None, errors="replace" is passed to
open(). Otherwise, errors="strict" is passed to open().
This behavior was previously only the case for engine="python".
Changed in version 1.3.0: encoding_errors is a new argument. encoding has no longer an
influence on how encoding errors are handled.
encoding_errorsstr, optional, default “strict”How encoding errors are treated. List of possible values .
New in version 1.3.0.
dialectstr or csv.Dialect, optionalIf provided, this parameter will override values (default or not) for the
following parameters: delimiter, doublequote, escapechar,
skipinitialspace, quotechar, and quoting. If it is necessary to
override values, a ParserWarning will be issued. See csv.Dialect
documentation for more details.
error_bad_linesbool, optional, default NoneLines with too many fields (e.g. a csv line with too many commas) will by
default cause an exception to be raised, and no DataFrame will be returned.
If False, then these “bad lines” will be dropped from the DataFrame that is
returned.
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon
encountering a bad line instead.
warn_bad_linesbool, optional, default NoneIf error_bad_lines is False, and warn_bad_lines is True, a warning for each
“bad line” will be output.
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon
encountering a bad line instead.
on_bad_lines{‘error’, ‘warn’, ‘skip’} or callable, default ‘error’Specifies what to do upon encountering a bad line (a line with too many fields).
Allowed values are :
‘error’, raise an Exception when a bad line is encountered.
‘warn’, raise a warning when a bad line is encountered and skip that line.
‘skip’, skip bad lines without raising or warning when they are encountered.
New in version 1.3.0.
New in version 1.4.0:
callable, function with signature
(bad_line: list[str]) -> list[str] | None that will process a single
bad line. bad_line is a list of strings split by the sep.
If the function returns None, the bad line will be ignored.
If the function returns a new list of strings with more elements than
expected, a ParserWarning will be emitted while dropping extra elements.
Only supported when engine="python"
delim_whitespacebool, default FalseSpecifies whether or not whitespace (e.g. ' ' or ' ') will be
used as the sep. Equivalent to setting sep='\s+'. If this option
is set to True, nothing should be passed in for the delimiter
parameter.
low_memorybool, default TrueInternally process the file in chunks, resulting in lower memory use
while parsing, but possibly mixed type inference. To ensure no mixed
types either set False, or specify the type with the dtype parameter.
Note that the entire file is read into a single DataFrame regardless,
use the chunksize or iterator parameter to return the data in chunks.
(Only valid with C parser).
memory_mapbool, default FalseIf a filepath is provided for filepath_or_buffer, map the file object
directly onto memory and access the data directly from there. Using this
option can improve performance because there is no longer any I/O overhead.
float_precisionstr, optionalSpecifies which converter the C engine should use for floating-point
values. The options are None or ‘high’ for the ordinary converter,
‘legacy’ for the original lower precision pandas converter, and
‘round_trip’ for the round-trip converter.
Changed in version 1.2.
storage_optionsdict, optionalExtra options that make sense for a particular storage connection, e.g.
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
are forwarded to urllib.request.Request as header options. For other
URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are
forwarded to fsspec.open. Please see fsspec and urllib for more
details, and for more examples on storage options refer here.
New in version 1.2.
Returns
DataFrame or TextParserA comma-separated values (csv) file is returned as two-dimensional
data structure with labeled axes.
See also
DataFrame.to_csvWrite DataFrame to a comma-separated values (csv) file.
read_csvRead a comma-separated values (csv) file into DataFrame.
read_fwfRead a table of fixed-width formatted lines into DataFrame.
Examples
>>> pd.read_csv('data.csv')
|
reference/api/pandas.read_csv.html
|
pandas.core.window.rolling.Rolling.corr
|
`pandas.core.window.rolling.Rolling.corr`
Calculate the rolling correlation.
If not supplied then will default to self and produce pairwise
output.
```
>>> v1 = [3, 3, 3, 5, 8]
>>> v2 = [3, 4, 4, 4, 8]
>>> # numpy returns a 2X2 array, the correlation coefficient
>>> # is the number at entry [0][1]
>>> print(f"{np.corrcoef(v1[:-1], v2[:-1])[0][1]:.6f}")
0.333333
>>> print(f"{np.corrcoef(v1[1:], v2[1:])[0][1]:.6f}")
0.916949
>>> s1 = pd.Series(v1)
>>> s2 = pd.Series(v2)
>>> s1.rolling(4).corr(s2)
0 NaN
1 NaN
2 NaN
3 0.333333
4 0.916949
dtype: float64
```
|
Rolling.corr(other=None, pairwise=None, ddof=1, numeric_only=False, **kwargs)[source]#
Calculate the rolling correlation.
Parameters
otherSeries or DataFrame, optionalIf not supplied then will default to self and produce pairwise
output.
pairwisebool, default NoneIf False then only matching columns between self and other will be
used and the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the
output will be a MultiIndexed DataFrame in the case of DataFrame
inputs. In the case of missing elements, only complete pairwise
observations will be used.
ddofint, default 1Delta Degrees of Freedom. The divisor used in calculations
is N - ddof, where N represents the number of elements.
numeric_onlybool, default FalseInclude only float, int, boolean columns.
New in version 1.5.0.
**kwargsFor NumPy compatibility and will not have an effect on the result.
Deprecated since version 1.5.0.
Returns
Series or DataFrameReturn type is the same as the original object with np.float64 dtype.
See also
covSimilar method to calculate covariance.
numpy.corrcoefNumPy Pearson’s correlation calculation.
pandas.Series.rollingCalling rolling with Series data.
pandas.DataFrame.rollingCalling rolling with DataFrames.
pandas.Series.corrAggregating corr for Series.
pandas.DataFrame.corrAggregating corr for DataFrame.
Notes
This function uses Pearson’s definition of correlation
(https://en.wikipedia.org/wiki/Pearson_correlation_coefficient).
When other is not specified, the output will be self correlation (e.g.
all 1’s), except for DataFrame inputs with pairwise
set to True.
Function will return NaN for correlations of equal valued sequences;
this is the result of a 0/0 division error.
When pairwise is set to False, only matching columns between self and
other will be used.
When pairwise is set to True, the output will be a MultiIndex DataFrame
with the original index on the first level, and the other DataFrame
columns on the second level.
In the case of missing elements, only complete pairwise observations
will be used.
Examples
The below example shows a rolling calculation with a window size of
four matching the equivalent function call using numpy.corrcoef().
>>> v1 = [3, 3, 3, 5, 8]
>>> v2 = [3, 4, 4, 4, 8]
>>> # numpy returns a 2X2 array, the correlation coefficient
>>> # is the number at entry [0][1]
>>> print(f"{np.corrcoef(v1[:-1], v2[:-1])[0][1]:.6f}")
0.333333
>>> print(f"{np.corrcoef(v1[1:], v2[1:])[0][1]:.6f}")
0.916949
>>> s1 = pd.Series(v1)
>>> s2 = pd.Series(v2)
>>> s1.rolling(4).corr(s2)
0 NaN
1 NaN
2 NaN
3 0.333333
4 0.916949
dtype: float64
The below example shows a similar rolling calculation on a
DataFrame using the pairwise option.
>>> matrix = np.array([[51., 35.], [49., 30.], [47., 32.], [46., 31.], [50., 36.]])
>>> print(np.corrcoef(matrix[:-1,0], matrix[:-1,1]).round(7))
[[1. 0.6263001]
[0.6263001 1. ]]
>>> print(np.corrcoef(matrix[1:,0], matrix[1:,1]).round(7))
[[1. 0.5553681]
[0.5553681 1. ]]
>>> df = pd.DataFrame(matrix, columns=['X','Y'])
>>> df
X Y
0 51.0 35.0
1 49.0 30.0
2 47.0 32.0
3 46.0 31.0
4 50.0 36.0
>>> df.rolling(4).corr(pairwise=True)
X Y
0 X NaN NaN
Y NaN NaN
1 X NaN NaN
Y NaN NaN
2 X NaN NaN
Y NaN NaN
3 X 1.000000 0.626300
Y 0.626300 1.000000
4 X 1.000000 0.555368
Y 0.555368 1.000000
|
reference/api/pandas.core.window.rolling.Rolling.corr.html
|
pandas.api.types.is_int64_dtype
|
`pandas.api.types.is_int64_dtype`
Check whether the provided array or dtype is of the int64 dtype.
```
>>> is_int64_dtype(str)
False
>>> is_int64_dtype(np.int32)
False
>>> is_int64_dtype(np.int64)
True
>>> is_int64_dtype('int8')
False
>>> is_int64_dtype('Int8')
False
>>> is_int64_dtype(pd.Int64Dtype)
True
>>> is_int64_dtype(float)
False
>>> is_int64_dtype(np.uint64) # unsigned
False
>>> is_int64_dtype(np.array(['a', 'b']))
False
>>> is_int64_dtype(np.array([1, 2], dtype=np.int64))
True
>>> is_int64_dtype(pd.Index([1, 2.])) # float
False
>>> is_int64_dtype(np.array([1, 2], dtype=np.uint32)) # unsigned
False
```
|
pandas.api.types.is_int64_dtype(arr_or_dtype)[source]#
Check whether the provided array or dtype is of the int64 dtype.
Parameters
arr_or_dtypearray-like or dtypeThe array or dtype to check.
Returns
booleanWhether or not the array or dtype is of the int64 dtype.
Notes
Depending on system architecture, the return value of is_int64_dtype(
int) will be True if the OS uses 64-bit integers and False if the OS
uses 32-bit integers.
Examples
>>> is_int64_dtype(str)
False
>>> is_int64_dtype(np.int32)
False
>>> is_int64_dtype(np.int64)
True
>>> is_int64_dtype('int8')
False
>>> is_int64_dtype('Int8')
False
>>> is_int64_dtype(pd.Int64Dtype)
True
>>> is_int64_dtype(float)
False
>>> is_int64_dtype(np.uint64) # unsigned
False
>>> is_int64_dtype(np.array(['a', 'b']))
False
>>> is_int64_dtype(np.array([1, 2], dtype=np.int64))
True
>>> is_int64_dtype(pd.Index([1, 2.])) # float
False
>>> is_int64_dtype(np.array([1, 2], dtype=np.uint32)) # unsigned
False
|
reference/api/pandas.api.types.is_int64_dtype.html
|
pandas.DataFrame.to_dict
|
`pandas.DataFrame.to_dict`
Convert the DataFrame to a dictionary.
```
>>> df = pd.DataFrame({'col1': [1, 2],
... 'col2': [0.5, 0.75]},
... index=['row1', 'row2'])
>>> df
col1 col2
row1 1 0.50
row2 2 0.75
>>> df.to_dict()
{'col1': {'row1': 1, 'row2': 2}, 'col2': {'row1': 0.5, 'row2': 0.75}}
```
|
DataFrame.to_dict(orient='dict', into=<class 'dict'>)[source]#
Convert the DataFrame to a dictionary.
The type of the key-value pairs can be customized with the parameters
(see below).
Parameters
orientstr {‘dict’, ‘list’, ‘series’, ‘split’, ‘tight’, ‘records’, ‘index’}Determines the type of the values of the dictionary.
‘dict’ (default) : dict like {column -> {index -> value}}
‘list’ : dict like {column -> [values]}
‘series’ : dict like {column -> Series(values)}
‘split’ : dict like
{‘index’ -> [index], ‘columns’ -> [columns], ‘data’ -> [values]}
‘tight’ : dict like
{‘index’ -> [index], ‘columns’ -> [columns], ‘data’ -> [values],
‘index_names’ -> [index.names], ‘column_names’ -> [column.names]}
‘records’ : list like
[{column -> value}, … , {column -> value}]
‘index’ : dict like {index -> {column -> value}}
Abbreviations are allowed. s indicates series and sp
indicates split.
New in version 1.4.0: ‘tight’ as an allowed value for the orient argument
intoclass, default dictThe collections.abc.Mapping subclass used for all Mappings
in the return value. Can be the actual class or an empty
instance of the mapping type you want. If you want a
collections.defaultdict, you must pass it initialized.
Returns
dict, list or collections.abc.MappingReturn a collections.abc.Mapping object representing the DataFrame.
The resulting transformation depends on the orient parameter.
See also
DataFrame.from_dictCreate a DataFrame from a dictionary.
DataFrame.to_jsonConvert a DataFrame to JSON format.
Examples
>>> df = pd.DataFrame({'col1': [1, 2],
... 'col2': [0.5, 0.75]},
... index=['row1', 'row2'])
>>> df
col1 col2
row1 1 0.50
row2 2 0.75
>>> df.to_dict()
{'col1': {'row1': 1, 'row2': 2}, 'col2': {'row1': 0.5, 'row2': 0.75}}
You can specify the return orientation.
>>> df.to_dict('series')
{'col1': row1 1
row2 2
Name: col1, dtype: int64,
'col2': row1 0.50
row2 0.75
Name: col2, dtype: float64}
>>> df.to_dict('split')
{'index': ['row1', 'row2'], 'columns': ['col1', 'col2'],
'data': [[1, 0.5], [2, 0.75]]}
>>> df.to_dict('records')
[{'col1': 1, 'col2': 0.5}, {'col1': 2, 'col2': 0.75}]
>>> df.to_dict('index')
{'row1': {'col1': 1, 'col2': 0.5}, 'row2': {'col1': 2, 'col2': 0.75}}
>>> df.to_dict('tight')
{'index': ['row1', 'row2'], 'columns': ['col1', 'col2'],
'data': [[1, 0.5], [2, 0.75]], 'index_names': [None], 'column_names': [None]}
You can also specify the mapping type.
>>> from collections import OrderedDict, defaultdict
>>> df.to_dict(into=OrderedDict)
OrderedDict([('col1', OrderedDict([('row1', 1), ('row2', 2)])),
('col2', OrderedDict([('row1', 0.5), ('row2', 0.75)]))])
If you want a defaultdict, you need to initialize it:
>>> dd = defaultdict(list)
>>> df.to_dict('records', into=dd)
[defaultdict(<class 'list'>, {'col1': 1, 'col2': 0.5}),
defaultdict(<class 'list'>, {'col1': 2, 'col2': 0.75})]
|
reference/api/pandas.DataFrame.to_dict.html
|
pandas.api.extensions.ExtensionDtype.is_dtype
|
`pandas.api.extensions.ExtensionDtype.is_dtype`
Check if we match ‘dtype’.
|
classmethod ExtensionDtype.is_dtype(dtype)[source]#
Check if we match ‘dtype’.
Parameters
dtypeobjectThe object to check.
Returns
bool
Notes
The default implementation is True if
cls.construct_from_string(dtype) is an instance
of cls.
dtype is an object and is an instance of cls
dtype has a dtype attribute, and any of the above
conditions is true for dtype.dtype.
|
reference/api/pandas.api.extensions.ExtensionDtype.is_dtype.html
|
pandas.Series.rfloordiv
|
`pandas.Series.rfloordiv`
Return Integer division of series and other, element-wise (binary operator rfloordiv).
Equivalent to other // series, but with support to substitute a fill_value for
missing data in either one of the inputs.
```
>>> a = pd.Series([1, 1, 1, np.nan], index=['a', 'b', 'c', 'd'])
>>> a
a 1.0
b 1.0
c 1.0
d NaN
dtype: float64
>>> b = pd.Series([1, np.nan, 1, np.nan], index=['a', 'b', 'd', 'e'])
>>> b
a 1.0
b NaN
d 1.0
e NaN
dtype: float64
>>> a.floordiv(b, fill_value=0)
a 1.0
b NaN
c NaN
d 0.0
e NaN
dtype: float64
```
|
Series.rfloordiv(other, level=None, fill_value=None, axis=0)[source]#
Return Integer division of series and other, element-wise (binary operator rfloordiv).
Equivalent to other // series, but with support to substitute a fill_value for
missing data in either one of the inputs.
Parameters
otherSeries or scalar value
levelint or nameBroadcast across a level, matching Index values on the
passed MultiIndex level.
fill_valueNone or float value, default None (NaN)Fill existing missing (NaN) values, and any new element needed for
successful Series alignment, with this value before computation.
If data in both corresponding Series locations is missing
the result of filling (at that location) will be missing.
axis{0 or ‘index’}Unused. Parameter needed for compatibility with DataFrame.
Returns
SeriesThe result of the operation.
See also
Series.floordivElement-wise Integer division, see Python documentation for more details.
Examples
>>> a = pd.Series([1, 1, 1, np.nan], index=['a', 'b', 'c', 'd'])
>>> a
a 1.0
b 1.0
c 1.0
d NaN
dtype: float64
>>> b = pd.Series([1, np.nan, 1, np.nan], index=['a', 'b', 'd', 'e'])
>>> b
a 1.0
b NaN
d 1.0
e NaN
dtype: float64
>>> a.floordiv(b, fill_value=0)
a 1.0
b NaN
c NaN
d 0.0
e NaN
dtype: float64
|
reference/api/pandas.Series.rfloordiv.html
|
pandas.tseries.offsets.FY5253.n
|
pandas.tseries.offsets.FY5253.n
|
FY5253.n#
|
reference/api/pandas.tseries.offsets.FY5253.n.html
|
Date offsets
|
Date offsets
|
DateOffset#
DateOffset
Standard kind of date increment used for a date range.
Properties#
DateOffset.freqstr
Return a string representing the frequency.
DateOffset.kwds
Return a dict of extra parameters for the offset.
DateOffset.name
Return a string representing the base frequency.
DateOffset.nanos
DateOffset.normalize
DateOffset.rule_code
DateOffset.n
DateOffset.is_month_start
Return boolean whether a timestamp occurs on the month start.
DateOffset.is_month_end
Return boolean whether a timestamp occurs on the month end.
Methods#
DateOffset.apply
DateOffset.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
DateOffset.copy
Return a copy of the frequency.
DateOffset.isAnchored
DateOffset.onOffset
DateOffset.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
DateOffset.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
DateOffset.__call__(*args, **kwargs)
Call self as a function.
DateOffset.is_month_start
Return boolean whether a timestamp occurs on the month start.
DateOffset.is_month_end
Return boolean whether a timestamp occurs on the month end.
DateOffset.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
DateOffset.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
DateOffset.is_year_start
Return boolean whether a timestamp occurs on the year start.
DateOffset.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessDay#
BusinessDay
DateOffset subclass representing possibly n business days.
Alias:
BDay
alias of pandas._libs.tslibs.offsets.BusinessDay
Properties#
BusinessDay.freqstr
Return a string representing the frequency.
BusinessDay.kwds
Return a dict of extra parameters for the offset.
BusinessDay.name
Return a string representing the base frequency.
BusinessDay.nanos
BusinessDay.normalize
BusinessDay.rule_code
BusinessDay.n
BusinessDay.weekmask
BusinessDay.holidays
BusinessDay.calendar
Methods#
BusinessDay.apply
BusinessDay.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessDay.copy
Return a copy of the frequency.
BusinessDay.isAnchored
BusinessDay.onOffset
BusinessDay.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessDay.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessDay.__call__(*args, **kwargs)
Call self as a function.
BusinessDay.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessDay.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessDay.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessDay.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessDay.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessDay.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessHour#
BusinessHour
DateOffset subclass representing possibly n business hours.
Properties#
BusinessHour.freqstr
Return a string representing the frequency.
BusinessHour.kwds
Return a dict of extra parameters for the offset.
BusinessHour.name
Return a string representing the base frequency.
BusinessHour.nanos
BusinessHour.normalize
BusinessHour.rule_code
BusinessHour.n
BusinessHour.start
BusinessHour.end
BusinessHour.weekmask
BusinessHour.holidays
BusinessHour.calendar
Methods#
BusinessHour.apply
BusinessHour.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessHour.copy
Return a copy of the frequency.
BusinessHour.isAnchored
BusinessHour.onOffset
BusinessHour.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessHour.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessHour.__call__(*args, **kwargs)
Call self as a function.
BusinessHour.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessHour.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessHour.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessHour.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessHour.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessHour.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessDay#
CustomBusinessDay
DateOffset subclass representing custom business days excluding holidays.
Alias:
CDay
alias of pandas._libs.tslibs.offsets.CustomBusinessDay
Properties#
CustomBusinessDay.freqstr
Return a string representing the frequency.
CustomBusinessDay.kwds
Return a dict of extra parameters for the offset.
CustomBusinessDay.name
Return a string representing the base frequency.
CustomBusinessDay.nanos
CustomBusinessDay.normalize
CustomBusinessDay.rule_code
CustomBusinessDay.n
CustomBusinessDay.weekmask
CustomBusinessDay.calendar
CustomBusinessDay.holidays
Methods#
CustomBusinessDay.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessDay.apply
CustomBusinessDay.copy
Return a copy of the frequency.
CustomBusinessDay.isAnchored
CustomBusinessDay.onOffset
CustomBusinessDay.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessDay.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessDay.__call__(*args, **kwargs)
Call self as a function.
CustomBusinessDay.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessDay.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessDay.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessDay.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessDay.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessDay.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessHour#
CustomBusinessHour
DateOffset subclass representing possibly n custom business days.
Properties#
CustomBusinessHour.freqstr
Return a string representing the frequency.
CustomBusinessHour.kwds
Return a dict of extra parameters for the offset.
CustomBusinessHour.name
Return a string representing the base frequency.
CustomBusinessHour.nanos
CustomBusinessHour.normalize
CustomBusinessHour.rule_code
CustomBusinessHour.n
CustomBusinessHour.weekmask
CustomBusinessHour.calendar
CustomBusinessHour.holidays
CustomBusinessHour.start
CustomBusinessHour.end
Methods#
CustomBusinessHour.apply
CustomBusinessHour.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessHour.copy
Return a copy of the frequency.
CustomBusinessHour.isAnchored
CustomBusinessHour.onOffset
CustomBusinessHour.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessHour.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessHour.__call__(*args, **kwargs)
Call self as a function.
CustomBusinessHour.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessHour.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessHour.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessHour.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessHour.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessHour.is_year_end
Return boolean whether a timestamp occurs on the year end.
MonthEnd#
MonthEnd
DateOffset of one month end.
Properties#
MonthEnd.freqstr
Return a string representing the frequency.
MonthEnd.kwds
Return a dict of extra parameters for the offset.
MonthEnd.name
Return a string representing the base frequency.
MonthEnd.nanos
MonthEnd.normalize
MonthEnd.rule_code
MonthEnd.n
Methods#
MonthEnd.apply
MonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
MonthEnd.copy
Return a copy of the frequency.
MonthEnd.isAnchored
MonthEnd.onOffset
MonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
MonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
MonthEnd.__call__(*args, **kwargs)
Call self as a function.
MonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
MonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
MonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
MonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
MonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
MonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
MonthBegin#
MonthBegin
DateOffset of one month at beginning.
Properties#
MonthBegin.freqstr
Return a string representing the frequency.
MonthBegin.kwds
Return a dict of extra parameters for the offset.
MonthBegin.name
Return a string representing the base frequency.
MonthBegin.nanos
MonthBegin.normalize
MonthBegin.rule_code
MonthBegin.n
Methods#
MonthBegin.apply
MonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
MonthBegin.copy
Return a copy of the frequency.
MonthBegin.isAnchored
MonthBegin.onOffset
MonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
MonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
MonthBegin.__call__(*args, **kwargs)
Call self as a function.
MonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
MonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
MonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
MonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
MonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
MonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessMonthEnd#
BusinessMonthEnd
DateOffset increments between the last business day of the month.
Alias:
BMonthEnd
alias of pandas._libs.tslibs.offsets.BusinessMonthEnd
Properties#
BusinessMonthEnd.freqstr
Return a string representing the frequency.
BusinessMonthEnd.kwds
Return a dict of extra parameters for the offset.
BusinessMonthEnd.name
Return a string representing the base frequency.
BusinessMonthEnd.nanos
BusinessMonthEnd.normalize
BusinessMonthEnd.rule_code
BusinessMonthEnd.n
Methods#
BusinessMonthEnd.apply
BusinessMonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessMonthEnd.copy
Return a copy of the frequency.
BusinessMonthEnd.isAnchored
BusinessMonthEnd.onOffset
BusinessMonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessMonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessMonthEnd.__call__(*args, **kwargs)
Call self as a function.
BusinessMonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessMonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessMonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessMonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessMonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessMonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
BusinessMonthBegin#
BusinessMonthBegin
DateOffset of one month at the first business day.
Alias:
BMonthBegin
alias of pandas._libs.tslibs.offsets.BusinessMonthBegin
Properties#
BusinessMonthBegin.freqstr
Return a string representing the frequency.
BusinessMonthBegin.kwds
Return a dict of extra parameters for the offset.
BusinessMonthBegin.name
Return a string representing the base frequency.
BusinessMonthBegin.nanos
BusinessMonthBegin.normalize
BusinessMonthBegin.rule_code
BusinessMonthBegin.n
Methods#
BusinessMonthBegin.apply
BusinessMonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BusinessMonthBegin.copy
Return a copy of the frequency.
BusinessMonthBegin.isAnchored
BusinessMonthBegin.onOffset
BusinessMonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BusinessMonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BusinessMonthBegin.__call__(*args, **kwargs)
Call self as a function.
BusinessMonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
BusinessMonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
BusinessMonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BusinessMonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BusinessMonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
BusinessMonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessMonthEnd#
CustomBusinessMonthEnd
Attributes
Alias:
CBMonthEnd
alias of pandas._libs.tslibs.offsets.CustomBusinessMonthEnd
Properties#
CustomBusinessMonthEnd.freqstr
Return a string representing the frequency.
CustomBusinessMonthEnd.kwds
Return a dict of extra parameters for the offset.
CustomBusinessMonthEnd.m_offset
CustomBusinessMonthEnd.name
Return a string representing the base frequency.
CustomBusinessMonthEnd.nanos
CustomBusinessMonthEnd.normalize
CustomBusinessMonthEnd.rule_code
CustomBusinessMonthEnd.n
CustomBusinessMonthEnd.weekmask
CustomBusinessMonthEnd.calendar
CustomBusinessMonthEnd.holidays
Methods#
CustomBusinessMonthEnd.apply
CustomBusinessMonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessMonthEnd.copy
Return a copy of the frequency.
CustomBusinessMonthEnd.isAnchored
CustomBusinessMonthEnd.onOffset
CustomBusinessMonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessMonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessMonthEnd.__call__(*args, **kwargs)
Call self as a function.
CustomBusinessMonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessMonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessMonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessMonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessMonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessMonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
CustomBusinessMonthBegin#
CustomBusinessMonthBegin
Attributes
Alias:
CBMonthBegin
alias of pandas._libs.tslibs.offsets.CustomBusinessMonthBegin
Properties#
CustomBusinessMonthBegin.freqstr
Return a string representing the frequency.
CustomBusinessMonthBegin.kwds
Return a dict of extra parameters for the offset.
CustomBusinessMonthBegin.m_offset
CustomBusinessMonthBegin.name
Return a string representing the base frequency.
CustomBusinessMonthBegin.nanos
CustomBusinessMonthBegin.normalize
CustomBusinessMonthBegin.rule_code
CustomBusinessMonthBegin.n
CustomBusinessMonthBegin.weekmask
CustomBusinessMonthBegin.calendar
CustomBusinessMonthBegin.holidays
Methods#
CustomBusinessMonthBegin.apply
CustomBusinessMonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
CustomBusinessMonthBegin.copy
Return a copy of the frequency.
CustomBusinessMonthBegin.isAnchored
CustomBusinessMonthBegin.onOffset
CustomBusinessMonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
CustomBusinessMonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
CustomBusinessMonthBegin.__call__(*args, ...)
Call self as a function.
CustomBusinessMonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
CustomBusinessMonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
CustomBusinessMonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
CustomBusinessMonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
CustomBusinessMonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
CustomBusinessMonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
SemiMonthEnd#
SemiMonthEnd
Two DateOffset's per month repeating on the last day of the month & day_of_month.
Properties#
SemiMonthEnd.freqstr
Return a string representing the frequency.
SemiMonthEnd.kwds
Return a dict of extra parameters for the offset.
SemiMonthEnd.name
Return a string representing the base frequency.
SemiMonthEnd.nanos
SemiMonthEnd.normalize
SemiMonthEnd.rule_code
SemiMonthEnd.n
SemiMonthEnd.day_of_month
Methods#
SemiMonthEnd.apply
SemiMonthEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
SemiMonthEnd.copy
Return a copy of the frequency.
SemiMonthEnd.isAnchored
SemiMonthEnd.onOffset
SemiMonthEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
SemiMonthEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
SemiMonthEnd.__call__(*args, **kwargs)
Call self as a function.
SemiMonthEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
SemiMonthEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
SemiMonthEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
SemiMonthEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
SemiMonthEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
SemiMonthEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
SemiMonthBegin#
SemiMonthBegin
Two DateOffset's per month repeating on the first day of the month & day_of_month.
Properties#
SemiMonthBegin.freqstr
Return a string representing the frequency.
SemiMonthBegin.kwds
Return a dict of extra parameters for the offset.
SemiMonthBegin.name
Return a string representing the base frequency.
SemiMonthBegin.nanos
SemiMonthBegin.normalize
SemiMonthBegin.rule_code
SemiMonthBegin.n
SemiMonthBegin.day_of_month
Methods#
SemiMonthBegin.apply
SemiMonthBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
SemiMonthBegin.copy
Return a copy of the frequency.
SemiMonthBegin.isAnchored
SemiMonthBegin.onOffset
SemiMonthBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
SemiMonthBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
SemiMonthBegin.__call__(*args, **kwargs)
Call self as a function.
SemiMonthBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
SemiMonthBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
SemiMonthBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
SemiMonthBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
SemiMonthBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
SemiMonthBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
Week#
Week
Weekly offset.
Properties#
Week.freqstr
Return a string representing the frequency.
Week.kwds
Return a dict of extra parameters for the offset.
Week.name
Return a string representing the base frequency.
Week.nanos
Week.normalize
Week.rule_code
Week.n
Week.weekday
Methods#
Week.apply
Week.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Week.copy
Return a copy of the frequency.
Week.isAnchored
Week.onOffset
Week.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Week.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Week.__call__(*args, **kwargs)
Call self as a function.
Week.is_month_start
Return boolean whether a timestamp occurs on the month start.
Week.is_month_end
Return boolean whether a timestamp occurs on the month end.
Week.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Week.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Week.is_year_start
Return boolean whether a timestamp occurs on the year start.
Week.is_year_end
Return boolean whether a timestamp occurs on the year end.
WeekOfMonth#
WeekOfMonth
Describes monthly dates like "the Tuesday of the 2nd week of each month".
Properties#
WeekOfMonth.freqstr
Return a string representing the frequency.
WeekOfMonth.kwds
Return a dict of extra parameters for the offset.
WeekOfMonth.name
Return a string representing the base frequency.
WeekOfMonth.nanos
WeekOfMonth.normalize
WeekOfMonth.rule_code
WeekOfMonth.n
WeekOfMonth.week
Methods#
WeekOfMonth.apply
WeekOfMonth.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
WeekOfMonth.copy
Return a copy of the frequency.
WeekOfMonth.isAnchored
WeekOfMonth.onOffset
WeekOfMonth.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
WeekOfMonth.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
WeekOfMonth.__call__(*args, **kwargs)
Call self as a function.
WeekOfMonth.weekday
WeekOfMonth.is_month_start
Return boolean whether a timestamp occurs on the month start.
WeekOfMonth.is_month_end
Return boolean whether a timestamp occurs on the month end.
WeekOfMonth.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
WeekOfMonth.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
WeekOfMonth.is_year_start
Return boolean whether a timestamp occurs on the year start.
WeekOfMonth.is_year_end
Return boolean whether a timestamp occurs on the year end.
LastWeekOfMonth#
LastWeekOfMonth
Describes monthly dates in last week of month.
Properties#
LastWeekOfMonth.freqstr
Return a string representing the frequency.
LastWeekOfMonth.kwds
Return a dict of extra parameters for the offset.
LastWeekOfMonth.name
Return a string representing the base frequency.
LastWeekOfMonth.nanos
LastWeekOfMonth.normalize
LastWeekOfMonth.rule_code
LastWeekOfMonth.n
LastWeekOfMonth.weekday
LastWeekOfMonth.week
Methods#
LastWeekOfMonth.apply
LastWeekOfMonth.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
LastWeekOfMonth.copy
Return a copy of the frequency.
LastWeekOfMonth.isAnchored
LastWeekOfMonth.onOffset
LastWeekOfMonth.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
LastWeekOfMonth.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
LastWeekOfMonth.__call__(*args, **kwargs)
Call self as a function.
LastWeekOfMonth.is_month_start
Return boolean whether a timestamp occurs on the month start.
LastWeekOfMonth.is_month_end
Return boolean whether a timestamp occurs on the month end.
LastWeekOfMonth.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
LastWeekOfMonth.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
LastWeekOfMonth.is_year_start
Return boolean whether a timestamp occurs on the year start.
LastWeekOfMonth.is_year_end
Return boolean whether a timestamp occurs on the year end.
BQuarterEnd#
BQuarterEnd
DateOffset increments between the last business day of each Quarter.
Properties#
BQuarterEnd.freqstr
Return a string representing the frequency.
BQuarterEnd.kwds
Return a dict of extra parameters for the offset.
BQuarterEnd.name
Return a string representing the base frequency.
BQuarterEnd.nanos
BQuarterEnd.normalize
BQuarterEnd.rule_code
BQuarterEnd.n
BQuarterEnd.startingMonth
Methods#
BQuarterEnd.apply
BQuarterEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BQuarterEnd.copy
Return a copy of the frequency.
BQuarterEnd.isAnchored
BQuarterEnd.onOffset
BQuarterEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BQuarterEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BQuarterEnd.__call__(*args, **kwargs)
Call self as a function.
BQuarterEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
BQuarterEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
BQuarterEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BQuarterEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BQuarterEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
BQuarterEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
BQuarterBegin#
BQuarterBegin
DateOffset increments between the first business day of each Quarter.
Properties#
BQuarterBegin.freqstr
Return a string representing the frequency.
BQuarterBegin.kwds
Return a dict of extra parameters for the offset.
BQuarterBegin.name
Return a string representing the base frequency.
BQuarterBegin.nanos
BQuarterBegin.normalize
BQuarterBegin.rule_code
BQuarterBegin.n
BQuarterBegin.startingMonth
Methods#
BQuarterBegin.apply
BQuarterBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BQuarterBegin.copy
Return a copy of the frequency.
BQuarterBegin.isAnchored
BQuarterBegin.onOffset
BQuarterBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BQuarterBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BQuarterBegin.__call__(*args, **kwargs)
Call self as a function.
BQuarterBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
BQuarterBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
BQuarterBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BQuarterBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BQuarterBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
BQuarterBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
QuarterEnd#
QuarterEnd
DateOffset increments between Quarter end dates.
Properties#
QuarterEnd.freqstr
Return a string representing the frequency.
QuarterEnd.kwds
Return a dict of extra parameters for the offset.
QuarterEnd.name
Return a string representing the base frequency.
QuarterEnd.nanos
QuarterEnd.normalize
QuarterEnd.rule_code
QuarterEnd.n
QuarterEnd.startingMonth
Methods#
QuarterEnd.apply
QuarterEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
QuarterEnd.copy
Return a copy of the frequency.
QuarterEnd.isAnchored
QuarterEnd.onOffset
QuarterEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
QuarterEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
QuarterEnd.__call__(*args, **kwargs)
Call self as a function.
QuarterEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
QuarterEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
QuarterEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
QuarterEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
QuarterEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
QuarterEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
QuarterBegin#
QuarterBegin
DateOffset increments between Quarter start dates.
Properties#
QuarterBegin.freqstr
Return a string representing the frequency.
QuarterBegin.kwds
Return a dict of extra parameters for the offset.
QuarterBegin.name
Return a string representing the base frequency.
QuarterBegin.nanos
QuarterBegin.normalize
QuarterBegin.rule_code
QuarterBegin.n
QuarterBegin.startingMonth
Methods#
QuarterBegin.apply
QuarterBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
QuarterBegin.copy
Return a copy of the frequency.
QuarterBegin.isAnchored
QuarterBegin.onOffset
QuarterBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
QuarterBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
QuarterBegin.__call__(*args, **kwargs)
Call self as a function.
QuarterBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
QuarterBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
QuarterBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
QuarterBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
QuarterBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
QuarterBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
BYearEnd#
BYearEnd
DateOffset increments between the last business day of the year.
Properties#
BYearEnd.freqstr
Return a string representing the frequency.
BYearEnd.kwds
Return a dict of extra parameters for the offset.
BYearEnd.name
Return a string representing the base frequency.
BYearEnd.nanos
BYearEnd.normalize
BYearEnd.rule_code
BYearEnd.n
BYearEnd.month
Methods#
BYearEnd.apply
BYearEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BYearEnd.copy
Return a copy of the frequency.
BYearEnd.isAnchored
BYearEnd.onOffset
BYearEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BYearEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BYearEnd.__call__(*args, **kwargs)
Call self as a function.
BYearEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
BYearEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
BYearEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BYearEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BYearEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
BYearEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
BYearBegin#
BYearBegin
DateOffset increments between the first business day of the year.
Properties#
BYearBegin.freqstr
Return a string representing the frequency.
BYearBegin.kwds
Return a dict of extra parameters for the offset.
BYearBegin.name
Return a string representing the base frequency.
BYearBegin.nanos
BYearBegin.normalize
BYearBegin.rule_code
BYearBegin.n
BYearBegin.month
Methods#
BYearBegin.apply
BYearBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
BYearBegin.copy
Return a copy of the frequency.
BYearBegin.isAnchored
BYearBegin.onOffset
BYearBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
BYearBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
BYearBegin.__call__(*args, **kwargs)
Call self as a function.
BYearBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
BYearBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
BYearBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
BYearBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
BYearBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
BYearBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
YearEnd#
YearEnd
DateOffset increments between calendar year ends.
Properties#
YearEnd.freqstr
Return a string representing the frequency.
YearEnd.kwds
Return a dict of extra parameters for the offset.
YearEnd.name
Return a string representing the base frequency.
YearEnd.nanos
YearEnd.normalize
YearEnd.rule_code
YearEnd.n
YearEnd.month
Methods#
YearEnd.apply
YearEnd.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
YearEnd.copy
Return a copy of the frequency.
YearEnd.isAnchored
YearEnd.onOffset
YearEnd.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
YearEnd.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
YearEnd.__call__(*args, **kwargs)
Call self as a function.
YearEnd.is_month_start
Return boolean whether a timestamp occurs on the month start.
YearEnd.is_month_end
Return boolean whether a timestamp occurs on the month end.
YearEnd.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
YearEnd.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
YearEnd.is_year_start
Return boolean whether a timestamp occurs on the year start.
YearEnd.is_year_end
Return boolean whether a timestamp occurs on the year end.
YearBegin#
YearBegin
DateOffset increments between calendar year begin dates.
Properties#
YearBegin.freqstr
Return a string representing the frequency.
YearBegin.kwds
Return a dict of extra parameters for the offset.
YearBegin.name
Return a string representing the base frequency.
YearBegin.nanos
YearBegin.normalize
YearBegin.rule_code
YearBegin.n
YearBegin.month
Methods#
YearBegin.apply
YearBegin.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
YearBegin.copy
Return a copy of the frequency.
YearBegin.isAnchored
YearBegin.onOffset
YearBegin.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
YearBegin.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
YearBegin.__call__(*args, **kwargs)
Call self as a function.
YearBegin.is_month_start
Return boolean whether a timestamp occurs on the month start.
YearBegin.is_month_end
Return boolean whether a timestamp occurs on the month end.
YearBegin.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
YearBegin.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
YearBegin.is_year_start
Return boolean whether a timestamp occurs on the year start.
YearBegin.is_year_end
Return boolean whether a timestamp occurs on the year end.
FY5253#
FY5253
Describes 52-53 week fiscal year.
Properties#
FY5253.freqstr
Return a string representing the frequency.
FY5253.kwds
Return a dict of extra parameters for the offset.
FY5253.name
Return a string representing the base frequency.
FY5253.nanos
FY5253.normalize
FY5253.rule_code
FY5253.n
FY5253.startingMonth
FY5253.variation
FY5253.weekday
Methods#
FY5253.apply
FY5253.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
FY5253.copy
Return a copy of the frequency.
FY5253.get_rule_code_suffix
FY5253.get_year_end
FY5253.isAnchored
FY5253.onOffset
FY5253.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
FY5253.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
FY5253.__call__(*args, **kwargs)
Call self as a function.
FY5253.is_month_start
Return boolean whether a timestamp occurs on the month start.
FY5253.is_month_end
Return boolean whether a timestamp occurs on the month end.
FY5253.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
FY5253.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
FY5253.is_year_start
Return boolean whether a timestamp occurs on the year start.
FY5253.is_year_end
Return boolean whether a timestamp occurs on the year end.
FY5253Quarter#
FY5253Quarter
DateOffset increments between business quarter dates for 52-53 week fiscal year.
Properties#
FY5253Quarter.freqstr
Return a string representing the frequency.
FY5253Quarter.kwds
Return a dict of extra parameters for the offset.
FY5253Quarter.name
Return a string representing the base frequency.
FY5253Quarter.nanos
FY5253Quarter.normalize
FY5253Quarter.rule_code
FY5253Quarter.n
FY5253Quarter.qtr_with_extra_week
FY5253Quarter.startingMonth
FY5253Quarter.variation
FY5253Quarter.weekday
Methods#
FY5253Quarter.apply
FY5253Quarter.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
FY5253Quarter.copy
Return a copy of the frequency.
FY5253Quarter.get_rule_code_suffix
FY5253Quarter.get_weeks
FY5253Quarter.isAnchored
FY5253Quarter.onOffset
FY5253Quarter.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
FY5253Quarter.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
FY5253Quarter.year_has_extra_week
FY5253Quarter.__call__(*args, **kwargs)
Call self as a function.
FY5253Quarter.is_month_start
Return boolean whether a timestamp occurs on the month start.
FY5253Quarter.is_month_end
Return boolean whether a timestamp occurs on the month end.
FY5253Quarter.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
FY5253Quarter.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
FY5253Quarter.is_year_start
Return boolean whether a timestamp occurs on the year start.
FY5253Quarter.is_year_end
Return boolean whether a timestamp occurs on the year end.
Easter#
Easter
DateOffset for the Easter holiday using logic defined in dateutil.
Properties#
Easter.freqstr
Return a string representing the frequency.
Easter.kwds
Return a dict of extra parameters for the offset.
Easter.name
Return a string representing the base frequency.
Easter.nanos
Easter.normalize
Easter.rule_code
Easter.n
Methods#
Easter.apply
Easter.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Easter.copy
Return a copy of the frequency.
Easter.isAnchored
Easter.onOffset
Easter.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Easter.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Easter.__call__(*args, **kwargs)
Call self as a function.
Easter.is_month_start
Return boolean whether a timestamp occurs on the month start.
Easter.is_month_end
Return boolean whether a timestamp occurs on the month end.
Easter.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Easter.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Easter.is_year_start
Return boolean whether a timestamp occurs on the year start.
Easter.is_year_end
Return boolean whether a timestamp occurs on the year end.
Tick#
Tick
Attributes
Properties#
Tick.delta
Tick.freqstr
Return a string representing the frequency.
Tick.kwds
Return a dict of extra parameters for the offset.
Tick.name
Return a string representing the base frequency.
Tick.nanos
Return an integer of the total number of nanoseconds.
Tick.normalize
Tick.rule_code
Tick.n
Methods#
Tick.copy
Return a copy of the frequency.
Tick.isAnchored
Tick.onOffset
Tick.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Tick.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Tick.__call__(*args, **kwargs)
Call self as a function.
Tick.apply
Tick.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Tick.is_month_start
Return boolean whether a timestamp occurs on the month start.
Tick.is_month_end
Return boolean whether a timestamp occurs on the month end.
Tick.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Tick.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Tick.is_year_start
Return boolean whether a timestamp occurs on the year start.
Tick.is_year_end
Return boolean whether a timestamp occurs on the year end.
Day#
Day
Attributes
Properties#
Day.delta
Day.freqstr
Return a string representing the frequency.
Day.kwds
Return a dict of extra parameters for the offset.
Day.name
Return a string representing the base frequency.
Day.nanos
Return an integer of the total number of nanoseconds.
Day.normalize
Day.rule_code
Day.n
Methods#
Day.copy
Return a copy of the frequency.
Day.isAnchored
Day.onOffset
Day.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Day.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Day.__call__(*args, **kwargs)
Call self as a function.
Day.apply
Day.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Day.is_month_start
Return boolean whether a timestamp occurs on the month start.
Day.is_month_end
Return boolean whether a timestamp occurs on the month end.
Day.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Day.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Day.is_year_start
Return boolean whether a timestamp occurs on the year start.
Day.is_year_end
Return boolean whether a timestamp occurs on the year end.
Hour#
Hour
Attributes
Properties#
Hour.delta
Hour.freqstr
Return a string representing the frequency.
Hour.kwds
Return a dict of extra parameters for the offset.
Hour.name
Return a string representing the base frequency.
Hour.nanos
Return an integer of the total number of nanoseconds.
Hour.normalize
Hour.rule_code
Hour.n
Methods#
Hour.copy
Return a copy of the frequency.
Hour.isAnchored
Hour.onOffset
Hour.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Hour.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Hour.__call__(*args, **kwargs)
Call self as a function.
Hour.apply
Hour.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Hour.is_month_start
Return boolean whether a timestamp occurs on the month start.
Hour.is_month_end
Return boolean whether a timestamp occurs on the month end.
Hour.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Hour.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Hour.is_year_start
Return boolean whether a timestamp occurs on the year start.
Hour.is_year_end
Return boolean whether a timestamp occurs on the year end.
Minute#
Minute
Attributes
Properties#
Minute.delta
Minute.freqstr
Return a string representing the frequency.
Minute.kwds
Return a dict of extra parameters for the offset.
Minute.name
Return a string representing the base frequency.
Minute.nanos
Return an integer of the total number of nanoseconds.
Minute.normalize
Minute.rule_code
Minute.n
Methods#
Minute.copy
Return a copy of the frequency.
Minute.isAnchored
Minute.onOffset
Minute.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Minute.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Minute.__call__(*args, **kwargs)
Call self as a function.
Minute.apply
Minute.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Minute.is_month_start
Return boolean whether a timestamp occurs on the month start.
Minute.is_month_end
Return boolean whether a timestamp occurs on the month end.
Minute.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Minute.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Minute.is_year_start
Return boolean whether a timestamp occurs on the year start.
Minute.is_year_end
Return boolean whether a timestamp occurs on the year end.
Second#
Second
Attributes
Properties#
Second.delta
Second.freqstr
Return a string representing the frequency.
Second.kwds
Return a dict of extra parameters for the offset.
Second.name
Return a string representing the base frequency.
Second.nanos
Return an integer of the total number of nanoseconds.
Second.normalize
Second.rule_code
Second.n
Methods#
Second.copy
Return a copy of the frequency.
Second.isAnchored
Second.onOffset
Second.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Second.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Second.__call__(*args, **kwargs)
Call self as a function.
Second.apply
Second.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Second.is_month_start
Return boolean whether a timestamp occurs on the month start.
Second.is_month_end
Return boolean whether a timestamp occurs on the month end.
Second.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Second.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Second.is_year_start
Return boolean whether a timestamp occurs on the year start.
Second.is_year_end
Return boolean whether a timestamp occurs on the year end.
Milli#
Milli
Attributes
Properties#
Milli.delta
Milli.freqstr
Return a string representing the frequency.
Milli.kwds
Return a dict of extra parameters for the offset.
Milli.name
Return a string representing the base frequency.
Milli.nanos
Return an integer of the total number of nanoseconds.
Milli.normalize
Milli.rule_code
Milli.n
Methods#
Milli.copy
Return a copy of the frequency.
Milli.isAnchored
Milli.onOffset
Milli.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Milli.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Milli.__call__(*args, **kwargs)
Call self as a function.
Milli.apply
Milli.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Milli.is_month_start
Return boolean whether a timestamp occurs on the month start.
Milli.is_month_end
Return boolean whether a timestamp occurs on the month end.
Milli.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Milli.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Milli.is_year_start
Return boolean whether a timestamp occurs on the year start.
Milli.is_year_end
Return boolean whether a timestamp occurs on the year end.
Micro#
Micro
Attributes
Properties#
Micro.delta
Micro.freqstr
Return a string representing the frequency.
Micro.kwds
Return a dict of extra parameters for the offset.
Micro.name
Return a string representing the base frequency.
Micro.nanos
Return an integer of the total number of nanoseconds.
Micro.normalize
Micro.rule_code
Micro.n
Methods#
Micro.copy
Return a copy of the frequency.
Micro.isAnchored
Micro.onOffset
Micro.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Micro.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Micro.__call__(*args, **kwargs)
Call self as a function.
Micro.apply
Micro.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Micro.is_month_start
Return boolean whether a timestamp occurs on the month start.
Micro.is_month_end
Return boolean whether a timestamp occurs on the month end.
Micro.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Micro.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Micro.is_year_start
Return boolean whether a timestamp occurs on the year start.
Micro.is_year_end
Return boolean whether a timestamp occurs on the year end.
Nano#
Nano
Attributes
Properties#
Nano.delta
Nano.freqstr
Return a string representing the frequency.
Nano.kwds
Return a dict of extra parameters for the offset.
Nano.name
Return a string representing the base frequency.
Nano.nanos
Return an integer of the total number of nanoseconds.
Nano.normalize
Nano.rule_code
Nano.n
Methods#
Nano.copy
Return a copy of the frequency.
Nano.isAnchored
Nano.onOffset
Nano.is_anchored
Return boolean whether the frequency is a unit frequency (n=1).
Nano.is_on_offset
Return boolean whether a timestamp intersects with this frequency.
Nano.__call__(*args, **kwargs)
Call self as a function.
Nano.apply
Nano.apply_index
(DEPRECATED) Vectorized apply of DateOffset to DatetimeIndex.
Nano.is_month_start
Return boolean whether a timestamp occurs on the month start.
Nano.is_month_end
Return boolean whether a timestamp occurs on the month end.
Nano.is_quarter_start
Return boolean whether a timestamp occurs on the quarter start.
Nano.is_quarter_end
Return boolean whether a timestamp occurs on the quarter end.
Nano.is_year_start
Return boolean whether a timestamp occurs on the year start.
Nano.is_year_end
Return boolean whether a timestamp occurs on the year end.
Frequencies#
to_offset
Return DateOffset object from string or datetime.timedelta object.
|
reference/offset_frequency.html
|
pandas.Index.is_monotonic_increasing
|
`pandas.Index.is_monotonic_increasing`
Return a boolean if the values are equal or increasing.
Examples
```
>>> Index([1, 2, 3]).is_monotonic_increasing
True
>>> Index([1, 2, 2]).is_monotonic_increasing
True
>>> Index([1, 3, 2]).is_monotonic_increasing
False
```
|
property Index.is_monotonic_increasing[source]#
Return a boolean if the values are equal or increasing.
Examples
>>> Index([1, 2, 3]).is_monotonic_increasing
True
>>> Index([1, 2, 2]).is_monotonic_increasing
True
>>> Index([1, 3, 2]).is_monotonic_increasing
False
|
reference/api/pandas.Index.is_monotonic_increasing.html
|
pandas.MultiIndex.droplevel
|
`pandas.MultiIndex.droplevel`
Return index with requested level(s) removed.
```
>>> mi = pd.MultiIndex.from_arrays(
... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'])
>>> mi
MultiIndex([(1, 3, 5),
(2, 4, 6)],
names=['x', 'y', 'z'])
```
|
MultiIndex.droplevel(level=0)[source]#
Return index with requested level(s) removed.
If resulting index has only 1 level left, the result will be
of Index type, not MultiIndex.
Parameters
levelint, str, or list-like, default 0If a string is given, must be the name of a level
If list-like, elements must be names or indexes of levels.
Returns
Index or MultiIndex
Examples
>>> mi = pd.MultiIndex.from_arrays(
... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'])
>>> mi
MultiIndex([(1, 3, 5),
(2, 4, 6)],
names=['x', 'y', 'z'])
>>> mi.droplevel()
MultiIndex([(3, 5),
(4, 6)],
names=['y', 'z'])
>>> mi.droplevel(2)
MultiIndex([(1, 3),
(2, 4)],
names=['x', 'y'])
>>> mi.droplevel('z')
MultiIndex([(1, 3),
(2, 4)],
names=['x', 'y'])
>>> mi.droplevel(['x', 'y'])
Int64Index([5, 6], dtype='int64', name='z')
|
reference/api/pandas.MultiIndex.droplevel.html
|
pandas.Timestamp.max
|
pandas.Timestamp.max
|
Timestamp.max = Timestamp('2262-04-11 23:47:16.854775807')#
|
reference/api/pandas.Timestamp.max.html
|
pandas.tseries.offsets.CustomBusinessDay.is_on_offset
|
`pandas.tseries.offsets.CustomBusinessDay.is_on_offset`
Return boolean whether a timestamp intersects with this frequency.
```
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Day(1)
>>> freq.is_on_offset(ts)
True
```
|
CustomBusinessDay.is_on_offset()#
Return boolean whether a timestamp intersects with this frequency.
Parameters
dtdatetime.datetimeTimestamp to check intersections with frequency.
Examples
>>> ts = pd.Timestamp(2022, 1, 1)
>>> freq = pd.offsets.Day(1)
>>> freq.is_on_offset(ts)
True
>>> ts = pd.Timestamp(2022, 8, 6)
>>> ts.day_name()
'Saturday'
>>> freq = pd.offsets.BusinessDay(1)
>>> freq.is_on_offset(ts)
False
|
reference/api/pandas.tseries.offsets.CustomBusinessDay.is_on_offset.html
|
pandas.Period.is_leap_year
|
`pandas.Period.is_leap_year`
Return True if the period’s year is in a leap year.
|
Period.is_leap_year#
Return True if the period’s year is in a leap year.
|
reference/api/pandas.Period.is_leap_year.html
|
pandas.tseries.offsets.Nano.nanos
|
`pandas.tseries.offsets.Nano.nanos`
Return an integer of the total number of nanoseconds.
```
>>> pd.offsets.Hour(5).nanos
18000000000000
```
|
Nano.nanos#
Return an integer of the total number of nanoseconds.
Raises
ValueErrorIf the frequency is non-fixed.
Examples
>>> pd.offsets.Hour(5).nanos
18000000000000
|
reference/api/pandas.tseries.offsets.Nano.nanos.html
|
pandas.tseries.offsets.CustomBusinessMonthEnd.weekmask
|
pandas.tseries.offsets.CustomBusinessMonthEnd.weekmask
|
CustomBusinessMonthEnd.weekmask#
|
reference/api/pandas.tseries.offsets.CustomBusinessMonthEnd.weekmask.html
|
pandas.tseries.offsets.FY5253Quarter.n
|
pandas.tseries.offsets.FY5253Quarter.n
|
FY5253Quarter.n#
|
reference/api/pandas.tseries.offsets.FY5253Quarter.n.html
|
pandas.tseries.offsets.CustomBusinessHour.rule_code
|
pandas.tseries.offsets.CustomBusinessHour.rule_code
|
CustomBusinessHour.rule_code#
|
reference/api/pandas.tseries.offsets.CustomBusinessHour.rule_code.html
|
Comparison with other tools
|
Comparison with other tools
|
Comparison with R / R libraries
Quick reference
Base R
plyr
reshape / reshape2
Comparison with SQL
Copies vs. in place operations
SELECT
WHERE
GROUP BY
JOIN
UNION
LIMIT
pandas equivalents for some SQL analytic and aggregate functions
UPDATE
DELETE
Comparison with spreadsheets
Data structures
Data input / output
Data operations
String processing
Merging
Other considerations
Comparison with SAS
Data structures
Data input / output
Data operations
String processing
Merging
Missing data
GroupBy
Other considerations
Comparison with Stata
Data structures
Data input / output
Data operations
String processing
Merging
Missing data
GroupBy
Other considerations
|
getting_started/comparison/index.html
|
pandas.tseries.offsets.FY5253Quarter.year_has_extra_week
|
pandas.tseries.offsets.FY5253Quarter.year_has_extra_week
|
FY5253Quarter.year_has_extra_week()#
|
reference/api/pandas.tseries.offsets.FY5253Quarter.year_has_extra_week.html
|
pandas.tseries.offsets.LastWeekOfMonth.rollforward
|
`pandas.tseries.offsets.LastWeekOfMonth.rollforward`
Roll provided date forward to next offset only if not on offset.
Rolled timestamp if not on offset, otherwise unchanged timestamp.
|
LastWeekOfMonth.rollforward()#
Roll provided date forward to next offset only if not on offset.
Returns
TimeStampRolled timestamp if not on offset, otherwise unchanged timestamp.
|
reference/api/pandas.tseries.offsets.LastWeekOfMonth.rollforward.html
|
pandas.tseries.offsets.BYearEnd.n
|
pandas.tseries.offsets.BYearEnd.n
|
BYearEnd.n#
|
reference/api/pandas.tseries.offsets.BYearEnd.n.html
|
pandas.tseries.offsets.SemiMonthEnd.day_of_month
|
pandas.tseries.offsets.SemiMonthEnd.day_of_month
|
SemiMonthEnd.day_of_month#
|
reference/api/pandas.tseries.offsets.SemiMonthEnd.day_of_month.html
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.