Search
Searching
- pandas.Series.str (Python method, in pandas.Series.str)
- 10 minutes to pandas
...the Cookbook. Customarily, we import as follows: In [1]: import numpy as np In [2]: import pandas as pd Basic data structures in pandas Pandas provides two types of classes for handling data: Series: a one-dimensional labeled array h...
- Categorical data
...rating via Likert scales. In contrast to statistical categorical variables, categorical data might have an order (e.g. ‘strongly agree’ vs ‘agree’ or ‘first observation’ vs. ‘second observation’), but numerical operations (additions, divisi...
- Comparison with SAS
Comparison with SAS For potential users coming from SAS this page is meant to demonstrate how different SAS operations would be performed in pandas. If you’re new to pandas, you might want to first read through 10 Min...
- Comparison with spreadsheets
...As is customary, we import pandas and NumPy as follows: In [1]: import pandas as pd In [2]: import numpy as np Data structures General terminology translation pandas Excel DataFrame worksheet Series column Index row headings...
- Comparison with Stata
Comparison with Stata For potential users coming from Stata this page is meant to demonstrate how different Stata operations would be performed in pandas. If you’re new to pandas, you might want to first read through...
- Cookbook
...1 2 3 3 3 2 1 In [55]: source_cols = df.columns # Or some subset would work too In [56]: new_cols = [str(x) + "_cat" for x in source_cols] In [57]: categories = {1: "Alpha", 2: "Beta", 3: "Charlie"} In [58]: df[new_cols...
- MultiIndex / advanced indexing
...called chained assignment and should be avoided. See Returning a View versus Copy. See the cookbook for some advanced strategies. Hierarchical indexing (MultiIndex) Hierarchical / Multi-level indexing is very exciting as it opens the doo...
- pandas.Index.str
pandas.Index.str Index.str()[source] Vectorized string functions for Series and Index. NAs stay NA unless handled otherwise by a particular method. Patterned after Python’s string methods, with some inspiration from...
- pandas.Series
...he data are used as the index. If the index is not None, the resulting Series is reindexed with the index values. dtypestr, numpy.dtype, or ExtensionDtype, optionalData type for the output Series. If not specified, this will be inferred fr...
- pandas.Series.__array__
...ay. Users should not call this directly. Rather, it is invoked by numpy.array() and numpy.asarray(). Parameters: dtypestr or numpy.dtype, optionalThe dtype to use for the resulting NumPy array. By default, the dtype is inferred from the d...
- pandas.Series.__iter__
...Series.__iter__()[source] Return an iterator 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: iterator Examples >>> s = pd...
- pandas.Series.add_prefix
pandas.Series.add_prefix Series.add_prefix(prefix, axis=None)[source] Prefix labels with string prefix. For Series, the row labels are prefixed. For DataFrame, the column labels are prefixed. Parameters: prefixstr...
- pandas.Series.add_suffix
pandas.Series.add_suffix Series.add_suffix(suffix, axis=None)[source] Suffix labels with string suffix. For Series, the row labels are suffixed. For DataFrame, the column labels are suffixed. Parameters: suffixstr...
- pandas.Series.agg
...0, *args, **kwargs)[source] Aggregate using one or more operations over the specified axis. Parameters: funcfunction, str, list or dictFunction to use for aggregating the data. If a function, must either work when passed a Series or when...
- pandas.Series.aggregate
...0, *args, **kwargs)[source] Aggregate using one or more operations over the specified axis. Parameters: funcfunction, str, list or dictFunction to use for aggregating the data. If a function, must either work when passed a Series or when...
- pandas.Series.asfreq
- pandas.Series.asof
- pandas.Series.astype
- pandas.Series.at_time
- pandas.Series.between_time
- pandas.Series.droplevel
- pandas.Series.dropna
- pandas.Series.dt.ceil
- pandas.Series.dt.day_name
- pandas.Series.dt.floor
- pandas.Series.dt.month_name
- pandas.Series.dt.round
- pandas.Series.dt.strftime
- pandas.Series.dt.to_period
- pandas.Series.dt.tz_convert
- pandas.Series.dt.tz_localize
- pandas.Series.ewm
- pandas.Series.expanding
- pandas.Series.explode
- pandas.Series.filter
- pandas.Series.first
- pandas.Series.hist
- pandas.Series.interpolate
- pandas.Series.last
- pandas.Series.pct_change
- pandas.Series.plot
- pandas.Series.plot.bar
- pandas.Series.plot.barh
- pandas.Series.plot.box
- pandas.Series.plot.density
- pandas.Series.plot.hist
- pandas.Series.plot.kde
- pandas.Series.plot.line
- pandas.Series.reindex
- pandas.Series.rename_axis
- pandas.Series.replace
- pandas.Series.resample
- pandas.Series.reset_index
- pandas.Series.rolling
- pandas.Series.sample
- pandas.Series.shift
- pandas.Series.sort_index
- pandas.Series.sort_values
- pandas.Series.str
- pandas.Series.str.capitalize
- pandas.Series.str.casefold
- pandas.Series.str.cat
- pandas.Series.str.center
- pandas.Series.str.contains
- pandas.Series.str.count