id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
pandas_user_guide/vectorizationinpanda_13_0.txt | Published in | |
pandas_user_guide/vectorizationinpanda_83_0.txt | 1. **Reduced Loop Overheads:** In traditional loops, there’s overhead associated with managing the loop index and checking loop conditions. With vectorization, you eliminate these overheads because the operations are applied to entire arrays.
2. **Optimized Low-Level Instructions:** Libraries like NumPy use optimized l... | |
pandas_user_guide/vectorizationinpanda_14_0.txt | Python in Plain English | |
pandas_user_guide/howtospeeduppythonpa_87_0.txt | [  | |
pandas_user_guide/pandas_user_guide_20_3.txt | 1.637410 -0.832585 NaN 0.818705
foo -0.097554 0.372851 NaN -0.048777 0.186425 NaN
C bar -0.744154 -2.392449 NaN -0.372077 -1.196224 NaN
foo 1.061810 NaN -3.491906 0.530905 NaN -1.745953
The result is a [ ` DataFrame `
](../reference/api/pandas.DataF... | |
pandas_user_guide/pandas_user_guide_20_8.txt | s.melt "pandas.melt") with more
customization for column matching.
In [56]: dft = pd.DataFrame(
....: {
....: "A1970": {0: "a", 1: "b", 2: "c"},
....: "A1980": {0: "d", 1: "e", 2: "f"},
....: "B1970": {0: 2.5, 1: 1.2, 2: 0.7},
....: "... | |
pandas_user_guide/vectorizationinpanda_2_0.txt | [ Sign in
](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fpython.plainenglish.io%2Fvectorization-
in-pandas-simplifying-data-operations-3a4fda08a184&source=post_page---
two_column_layout_nav-----------------------global_nav-----------) | |
pandas_user_guide/pandas_user_guide_18_14.txt | 8 9
1990-01-01 04:00:00 17 9 10 11
1990-01-01 05:00:00 21 11 12 13
##### Option 2: read column names and then data #
In [203]: pd.read_csv(StringIO(data), sep=";", header=10, nrows=10).columns
Out[203]: Index(['date', 'Param1', 'Param... | |
pandas_user_guide/vectorizationinpanda_31_0.txt | Output:
0 5
1 7
2 9 | |
pandas_user_guide/howtospeeduppythonpa_104_0.txt | February 2, 2023 7 min read | |
pandas_user_guide/pandasvectorization_22_0.txt |
Out[56]: | |
pandas_user_guide/vectorizationinpanda_129_0.txt | ](https://policy.medium.com/medium-terms-of-
service-9db0094a1e0f?source=post_page-----
3a4fda08a184--------------------------------) | |
pandas_user_guide/pandas_user_guide_11_6.txt | ormant expression evaluation of [ ` Series `
](../reference/api/pandas.Series.html#pandas.Series "pandas.Series") and [ `
DataFrame ` ](../reference/api/pandas.DataFrame.html#pandas.DataFrame
"pandas.DataFrame") . Expression evaluation allows operations to be expressed
as strings and can potentially provide a perform... | |
pandas_user_guide/howtospeeduppythonpa_172_0.txt | [  | |
pandas_user_guide/vectorizationinpanda_105_0.txt | [ Follow
](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fsubscribe%2Fuser%2Ff319c9e06fc1&operation=register&redirect=https%3A%2F%2Fpython.plainenglish.io%2Fvectorization-
in-pandas-simplifying-data-
operations-3a4fda08a184&user=Gaurav+Kumar&userId=f319c9e06fc1&source=post_page-f319c9e06fc1
----3a... | |
pandas_user_guide/pandas_user_guide_25_14.txt | 1
1 2
2 3
dtype: int64
In [143]: se[5] = 5.
In [144]: se
Out[144]:
0 1.0
1 2.0
2 3.0
5 5.0
dtype: float64
A ` DataFrame ` can be enlarged on either axis via ` .loc ` .
In [145]: dfi = pd.DataFrame(np.arange(6).reshape(3, ... | |
pandas_user_guide/pandas_user_guide_16_2.txt | ndle duplicate labels, rather than just
dropping the repeats, using ` groupby() ` on the index is a common trick. For
example, weâll resolve duplicates by taking the average of all rows with the
same label.
In [18]: df2.groupby(level=0).mean()
Out[18]:
A
a 0.5
b 2.0
## D... | |
pandas_user_guide/pandas_user_guide_26_15.txt | ear).transform(lambda x: x.max() - x.min())
In [164]: grouped = ts.groupby(lambda x: x.year)
In [165]: result = grouped.transform("max") - grouped.transform("min")
# grouped = data_df.groupby(key)
# result = grouped.transform(lambda x: x.fillna(x.mean()))
In [166]: grouped = data_df.groupb... | |
pandas_user_guide/pandas_user_guide_7_2.txt | these are generally strings meant to be displayed on the console.
[default: utf-8] [currently: utf8]
display.expand_frame_repr : boolean
Whether to print out the full DataFrame repr for wide DataFrames across
multiple lines, `max_columns` is still respected, but the output will
w... | |
pandas_user_guide/pandas_user_guide_9_1.txt | Index.html#pandas.MultiIndex
"pandas.MultiIndex") object is the hierarchical analogue of the standard [ `
Index ` ](../reference/api/pandas.Index.html#pandas.Index "pandas.Index")
object which typically stores the axis labels in pandas objects. You can think
of ` MultiIndex ` as an array of tuples where each tuple is... | |
pandas_user_guide/vectorizationinpanda_73_0.txt | # Measure execution time for NumPy vectorized approach
numpy_time = timeit.timeit(numpy_vectorized, number=100) | |
pandas_user_guide/pandas_user_guide_5_12.txt | e.transform")
4. Applying Elementwise Functions : [ ` map() ` ](../reference/api/pandas.DataFrame.map.html#pandas.DataFrame.map "pandas.DataFrame.map")
### Tablewise function application #
` DataFrames ` and ` Series ` can be passed into functions. However, if the
function needs to be called in a chain, cons... | |
pandas_user_guide/pandas_user_guide_25_13.txt | columns from a Series or DataFrame with the [ `
sample() `
](../reference/api/pandas.DataFrame.sample.html#pandas.DataFrame.sample
"pandas.DataFrame.sample") method. The method will sample rows by default, and
accepts a specific number of rows/columns to return, or a fraction of rows.
In [122]: s = pd.S... | |
pandas_user_guide/pandas_user_guide_1_3.txt | pandas.read_json")
* [ ` read_orc() ` ](../reference/api/pandas.read_orc.html#pandas.read_orc "pandas.read_orc")
* [ ` read_feather() ` ](../reference/api/pandas.read_feather.html#pandas.read_feather "pandas.read_feather")
In [51]: import io
In [52]: data = io.StringIO("""a,b,c
..... | |
pandas_user_guide/pandasvectorization_31_0.txt | one 2.5
two 2.5
dtype: float64 | |
pandas_user_guide/pandas_user_guide_5_22.txt | .692424
c -0.303893
d -1.425662
e 1.114285
dtype: float64
In [244]: s.rename(str.upper)
Out[244]:
A -0.186646
B -1.692424
C -0.303893
D -1.425662
E 1.114285
dtype: float64
If you pass a function, it must return a value when called with any of... | |
pandas_user_guide/vectorizationinpanda_60_0.txt | # Vectorized Processing with NumPy | |
pandas_user_guide/pandas_user_guide_24_2.txt |
---|---|---
Monday | Heavy Rain | Heavy Rain
Tuesday | Heavy Rain | Heavy Rain
Wednesday | Dry | Rain
Thursday | Dry | Heavy Rain
Friday | Dry | Heavy Rain
### Hiding Data #
The index and column headers can be completely hidden, as well subselecting
rows or columns that one... | |
pandas_user_guide/pandas_user_guide_26_8.txt | foo one 2.0 -0.491888 0.117887 ... 0.807291 1.076676 1.346061
three 1.0 -0.862495 NaN ... 0.024580 0.024580 0.024580
two 2.0 0.024925 1.652692 ... 0.592714 1.109898 1.627081
[6 rows x 16 columns]
Another aggregation example is to compute the number of uni... | |
pandas_user_guide/pandas_user_guide_27_5.txt | string, default None
Specifies which converter the C engine should use for floating-point values.
The options are ` None ` for the ordinary converter, ` high ` for the high-
precision converter, and ` round_trip ` for the round-trip converter.
lineterminator str (length 1), default ` None `
Charact... | |
pandas_user_guide/tutorialbasicvectori_14_0.txt | By clicking Continue to join or sign in, you agree to LinkedIn’s [ User
Agreement ](/legal/user-agreement?trk=article-ssr-frontend-pulse_contextual-
sign-in-modal_sign-in-modal_auth-button_user-agreement) , [ Privacy Policy
](/legal/privacy-policy?trk=article-ssr-frontend-pulse_contextual-sign-in-
modal_sign-in-modal_a... | |
pandas_user_guide/vectorizationinpanda_15_0.txt | ](https://python.plainenglish.io/?source=post_page-----
3a4fda08a184--------------------------------) | |
pandas_user_guide/vectorizationinpanda_22_0.txt | Share | |
pandas_user_guide/vectorizationinpanda_11_0.txt | [ Gaurav Kumar ](https://gaurav-adarshi.medium.com/?source=post_page-----
3a4fda08a184--------------------------------) | |
pandas_user_guide/pandas_user_guide_27_37.txt | bute ` xmlns ` . In
order to parse by node under a namespace context, ` xpath ` must reference a
prefix.
For example, below XML contains a namespace with prefix, ` doc ` , and URI at
` https://example.com ` . In order to parse ` doc:row ` nodes, ` namespaces
` must be used.
In [396]: xml = """<?xml... | |
pandas_user_guide/howtospeeduppythonpa_55_0.txt | The reason why vectorization is so much faster than Looping/Iterating and
Apply is that it doesn’t calculate the entire row every single time but
instead applies the parameters to the entire dataset as a whole. Vectorization
is a process where operations are applied to entire arrays of data at once,
instead of operatin... | |
pandas_user_guide/pandas_user_guide_24_5.txt | asy to add a ` class ` to the main ` <table> ` using [
.set_table_attributes()
](../reference/api/pandas.io.formats.style.Styler.set_table_attributes.html) .
This method can also attach inline styles - read more in CSS Hierarchies .
[19]:
out = s.set_table_attributes('class="my-tabl... | |
pandas_user_guide/pandas_user_guide_5_5.txt | son methods ` eq ` , ` ne ` , `
lt ` , ` gt ` , ` le ` , and ` ge ` whose behavior is analogous to the
binary arithmetic operations described above:
In [48]: df.gt(df2)
Out[48]:
one two three
a False False False
b False False False
c False False False
d F... | |
pandas_user_guide/pandas_user_guide_10_6.txt | om.rand(4, 2), index=["a", "b", "c", "d"], columns=["x", "y"]
....: )
....:
In [88]: df.plot.pie(subplots=True, figsize=(8, 4));

You can use the ` labels ` and ` colors ` keywords to specify the labels and
colors of each wedge.
... | |
pandas_user_guide/pandasvectorization_25_0.txt | # mean of every single column in df
df.apply(np.mean) | |
pandas_user_guide/pandas_user_guide_15_5.txt | t(cluster)
>>> client
<Client: 'tcp://127.0.0.1:53349' processes=4 threads=8, memory=17.18 GB>
Once this ` client ` is created, all of Daskâs computation will take place
on the cluster (which is just processes in this case).
Dask implements the most used parts of the pandas API. For example, we can do... | |
pandas_user_guide/pandas_user_guide_2_14.txt | ries.offsets.WeekOfMonth") | ` 'WOM' ` | the x-th day of the y-th week of each month
[ ` LastWeekOfMonth ` ](../reference/api/pandas.tseries.offsets.LastWeekOfMonth.html#pandas.tseries.offsets.LastWeekOfMonth "pandas.tseries.offsets.LastWeekOfMonth") | ` 'LWOM' ` | the x-th day of the last week of each month ... | |
pandas_user_guide/tutorialbasicvectori_45_0.txt | ## What is Vectorization? | |
pandas_user_guide/howtospeeduppythonpa_48_0.txt | ### Vectorization | |
pandas_user_guide/pandas_user_guide_5_30.txt | l#api-arrays-float-na) | [ ` Float64Dtype ` ](../reference/api/pandas.Float64Dtype.html#pandas.Float64Dtype "pandas.Float64Dtype") , ⦠| (none) | [ ` arrays.FloatingArray ` ](../reference/api/pandas.arrays.FloatingArray.html#pandas.arrays.FloatingArray "pandas.arrays.FloatingArray") | ` 'Float32' ` , ` 'Floa... | |
pandas_user_guide/pandas_user_guide_3_0.txt | Skip to main content
__ Back to top
__ ` Ctrl ` \+ ` K `
[  ](../index.html)
Site Navigation
* [ Getting started ](../getting_started/index.html)
* [ User Guide ](index.html)
* [ API reference ](../reference/index.html)
* [ Development ](../develop... | |
pandas_user_guide/pandas_user_guide_8_10.txt | Y3")],
.....: names=["key", "Y"],
.....: )
.....:
In [106]: right = pd.DataFrame(
.....: {"C": ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"]},
.....: index=index,
.....: )
.....:
In [107]: result = left.join(right, how="inner")
... | |
pandas_user_guide/howtospeeduppythonpa_132_0.txt | %%timeit
df = get_data()
for index, row in df.iterrows():
df.loc[index, 'reward'] = reward_calc(row) | |
pandas_user_guide/tutorialbasicvectori_68_0.txt | Support | |
pandas_user_guide/pandas_user_guide_5_11.txt | a = {"a": [1, 2, 3, 4], "b": ["x", "x", "y", "y"]}
In [123]: frame = pd.DataFrame(data)
In [124]: frame.value_counts()
Out[124]:
a b
1 x 1
2 x 1
3 y 1
4 y 1
Name: count, dtype: int64
Similarly, you can get the most frequently occurring value(s), i.e.... | |
pandas_user_guide/vectorizationinpanda_26_0.txt | Let’s dive into some examples to better understand vectorization in Pandas. | |
pandas_user_guide/vectorizationinpanda_85_0.txt | ## QuizShorts | Vectorization in Pandas: Simplifying Data Operations | |
pandas_user_guide/pandas_user_guide_2_23.txt | 72]: AbstractHolidayCalendar.end_date = datetime.datetime(2012, 12, 31)
In [273]: cal.holidays()
Out[273]: DatetimeIndex(['2012-05-28', '2012-07-04', '2012-10-08'], dtype='datetime64[ns]', freq=None)
Every calendar class is accessible by name using the ` get_calendar `
function which returns a holid... | |
pandas_user_guide/tutorialbasicvectori_46_0.txt | Vectorization is a technique in Pandas that leverages the underlying NumPy
library to perform operations on entire arrays or Series, rather than
iterating through individual elements. It is generally the most efficient way
to work with data in Pandas. | |
pandas_user_guide/tutorialbasicvectori_62_0.txt | In the next tutorial, I will show the detailed comparison on the typical case:
Feature Engineering on Pandas Date data. | |
pandas_user_guide/pandas_user_guide_2_22.txt | iday calendar class. Furthermore, the ` start_date `
and ` end_date ` class attributes determine over what date range holidays are
generated. These should be overwritten on the ` AbstractHolidayCalendar `
class to have the range apply to all calendar subclasses. `
USFederalHolidayCalendar ` is the only calendar tha... | |
pandas_user_guide/tutorialbasicvectori_10_0.txt | Password | |
pandas_user_guide/howtospeeduppythonpa_140_0.txt | 404 ms ± 18.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) | |
pandas_user_guide/howtospeeduppythonpa_26_0.txt | ### The Parameters and Rules | |
pandas_user_guide/vectorizationinpanda_48_0.txt | # Benefits of Vectorization | |
pandas_user_guide/vectorizationinpanda_72_0.txt | # Traditional loop-based processing
def loop_based():
result = []
for i in range(len(list1)):
result.append(list1[i] + list2[i]) | |
pandas_user_guide/pandas_user_guide_8_1.txt | #pandas.Series "pandas.Series") or [ ` DataFrame ` ](../reference/api/pandas.DataFrame.html#pandas.DataFrame "pandas.DataFrame") objects along an ordered axis
* [ ` merge_asof() ` ](../reference/api/pandas.merge_asof.html#pandas.merge_asof "pandas.merge_asof") : Combine two [ ` Series ` ](../reference/api/pandas... | |
pandas_user_guide/pandas_user_guide_18_6.txt | -dataframe-by-key)
In [107]: gb = df.groupby("animal")
In [108]: gb.get_group("cat")
Out[108]:
animal size weight adult
0 cat S 8 False
2 cat M 11 False
5 cat L 12 True
6 cat L 12 True
[ Apply to different item... | |
pandas_user_guide/pandas_user_guide_9_16.txt | dex([(2017-01-01 00:00:00, 2017-01-02 00:00:00],
(2017-01-02 00:00:00, 2017-01-03 00:00:00],
(2017-01-03 00:00:00, 2017-01-04 00:00:00],
(2017-01-04 00:00:00, 2017-01-05 00:00:00]],
dtype='interval[datetime64[ns], right]')
In [199]: pd.... | |
pandas_user_guide/pandas_user_guide_27_61.txt | produces better compression ratios at the expense of speed.
* [ blosc:snappy ](https://google.github.io/snappy/) : A popular compressor used in many places.
* [ blosc:zlib ](https://zlib.net/) : A classic; somewhat slower than the previous ones, but achieving better compression ratios.
* [ blos... | |
pandas_user_guide/pandas_user_guide_10_5.txt | umn of the ` DataFrame ` as the bubble size.
In [77]: df.plot.scatter(x="a", y="b", s=df["c"] * 200);

See the [ ` scatter `
](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.scatter.html#matplotlib.axes.Axes... | |
pandas_user_guide/howtospeeduppythonpa_178_0.txt | #### Topics | |
pandas_user_guide/pandas_user_guide_24_10.txt | |---|---
0 | 1.764052 | 0.400157 | 0.978738 | 2.240893
1 | 1.867558 | -0.977278 | 0.950088 | -0.151357
2 | -0.103219 | 0.410599 | 0.144044 | 1.454274
3 | 0.761038 | 0.121675 | 0.443863 | 0.333674
4 | 1.494079 | -0.205158 | 0.313068 | -0.854096
5 | -2.552990 | ... | |
pandas_user_guide/tutorialbasicvectori_69_0.txt | Love | |
pandas_user_guide/tutorialbasicvectori_41_0.txt | 5. Performance Comparison | |
pandas_user_guide/howtospeeduppythonpa_12_0.txt | 7 min read | |
pandas_user_guide/pandas_user_guide_10_9.txt | images/series_plot_logy.png)
See also the ` logx ` and ` loglog ` keyword arguments.
### Plotting on a secondary y-axis #
To plot data on a secondary y-axis, use the ` secondary_y ` keyword:
In [132]: df["A"].plot();
In [133]: df["B"].plot(secondary_y=True, style="g");
![../_images... | |
pandas_user_guide/pandas_user_guide_18_12.txt | ....: df,
.....: left_on=["Bins", "Area", "Test_0"],
.....: right_on=["Bins", "Area", "Test_1"],
.....: suffixes=("_L", "_R"),
.....: )
.....:
Out[185]:
Area Bins Test_0_L Data_L Test_1_L Test_0_R Data_R Test_1_R
0 A 110 0 -0.433... | |
pandas_user_guide/tutorialbasicvectori_49_0.txt | This code adds the ‘A’ and ‘B’ columns element-wise and stores the result in a
new column ‘C’. No explicit iteration is required, which makes the code more
efficient. | |
pandas_user_guide/howtospeeduppythonpa_141_0.txt | Wow, so much faster! About 9x faster, a huge improvement to a Loop. Now the
Apply Function is perfectly fine to use and will be applicable in certain
scenarios, but for our use case, let's see if we can speed it up more. | |
pandas_user_guide/pandas_user_guide_24_30.txt | tyler):
env = Environment(
loader=ChoiceLoader([
FileSystemLoader("templates"), # contains ours
Styler.loader, # the default
])
)
template_html_table = env.get_template("myhtml.tpl")
Notice that we include the original loader in our... | |
pandas_user_guide/pandasvectorization_33_0.txt | # .map() on particular columns (Series)
# goes through every value in column and evaluate if it's > 1
df['one'].map(lambda x: x >= 1) | |
pandas_user_guide/pandas_user_guide_4_3.txt | . The ` categories
` argument is optional, which implies that the actual categories should be
inferred from whatever is present in the data when the [ ` pandas.Categorical
` ](../reference/api/pandas.Categorical.html#pandas.Categorical
"pandas.Categorical") is created. The categories are assumed to be unordered
by def... | |
pandas_user_guide/pandas_user_guide_4_14.txt | ories (5, int64): [1, 2, 3, 4, 10]
Use ` copy=True ` to prevent such a behaviour or simply donât reuse `
Categoricals ` :
In [271]: cat = pd.Categorical([1, 2, 3, 10], categories=[1, 2, 3, 4, 10])
In [272]: s = pd.Series(cat, name="cat", copy=True)
In [273]: cat
Out[273]: ... | |
pandas_user_guide/pandas_user_guide_5_19.txt | three two one
c 1.227435 1.478369 0.695246
f NaN NaN NaN
b -0.050390 1.912123 0.343054
Note that the ` Index ` objects containing the actual axis labels can be
**shared** between objects. So if we have a Series and a DataFrame, the
following can be done:
... | |
pandas_user_guide/pandas_user_guide_18_3.txt | stions/16575868/efficiently-creating-
additional-columns-in-a-pandas-dataframe-using-map)
In [53]: df = pd.DataFrame({"AAA": [1, 2, 1, 3], "BBB": [1, 1, 2, 2], "CCC": [2, 1, 3, 1]})
In [54]: df
Out[54]:
AAA BBB CCC
0 1 1 2
1 2 1 1
2 1 2 3
... | |
pandas_user_guide/pandas_user_guide_18_5.txt |
In [97]: df.loc[(All, "Math"), ("Exams")]
Out[97]:
I II
Student Course
Ada Math 71 73
Quinn Math 74 76
Violet Math 77 79
In [98]: df.loc[(All, "Math"), (All, "II")]
Out[98]:
Exams Labs
II... | |
pandas_user_guide/vectorizationinpanda_16_0.txt | 6 min read | |
pandas_user_guide/pandas_user_guide_9_14.txt | rence/api/pandas.Series.html#pandas.Series
"pandas.Series") objects. ` RangeIndex ` is an optimized version of ` Index
` that can represent a monotonic ordered set. These are analogous to Python [
range types ](https://docs.python.org/3/library/stdtypes.html#typesseq-range)
. A ` RangeIndex ` will always have an ` in... | |
pandas_user_guide/howtospeeduppythonpa_162_0.txt | #### Managing Python Dependencies with Poetry vs Conda & Pip | |
pandas_user_guide/pandas_user_guide_15_3.txt | ok=True)
In [31]: for i, (start, end) in enumerate(zip(starts, ends)):
....: ts = make_timeseries(start=start, end=end, freq="1min", seed=i)
....: ts.to_parquet(f"data/timeseries/ts-{i:0>2d}.parquet")
....:
data
âââ timeseries
âââ ts-00.p... | |
pandas_user_guide/pandas_user_guide_24_31.txt | d Text Gradient
* Set properties
* Bar charts
* Sharing styles
* Limitations
* Other Fun and Useful Stuff
* Widgets
* Magnify
* Sticky Headers
* HTML Escaping
* Export to Excel
* Export to LaTeX
* More About CSS and HTML
* CSS Classes and Ids
* CSS Hierarchies
... | |
pandas_user_guide/pandas_user_guide_26_23.txt | on. The ` mean
` function can be any function that takes in a GroupBy object; the ` .pipe `
will pass the GroupBy object as a parameter into the function you specify.
## Examples #
### Multi-column factorization #
By using [ ` DataFrameGroupBy.ngroup() `
](../reference/api/pandas.core.groupby.DataFrameGroupBy.... | |
pandas_user_guide/pandas_user_guide_27_14.txt | )
Above, only an empty field will be recognized as ` NaN ` .
pd.read_csv("path_to_file.csv", keep_default_na=False, na_values=["NA", "0"])
Above, both ` NA ` and ` 0 ` as strings are ` NaN ` .
pd.read_csv("path_to_file.csv", na_values=["Nope"])
The default values, in ... | |
pandas_user_guide/pandasvectorization_13_0.txt |
In [52]: | |
pandas_user_guide/vectorizationinpanda_53_0.txt | # Traditional Loop-Based Processing | |
pandas_user_guide/tutorialbasicvectori_11_0.txt | Show | |
pandas_user_guide/pandas_user_guide_27_29.txt | ` .
In [312]: s_per = pd.Series(1, index=pd.period_range("2016", freq="Y-DEC", periods=4))
In [313]: build_table_schema(s_per)
Out[313]:
{'fields': [{'name': 'index', 'type': 'datetime', 'freq': 'YE-DEC'},
{'name': 'values', 'type': 'integer'}],
'primaryKey': ['index'],
... | |
pandas_user_guide/howtospeeduppythonpa_85_0.txt | [ Contact us today chevron_right ](/Contact-Us) | |
pandas_user_guide/pandas_user_guide_9_7.txt | side of an alignable object as well.
In [67]: df2 = dfmi.copy()
In [68]: df2.loc[idx[:, :, ["C1", "C3"]], :] = df2 * 1000
In [69]: df2
Out[69]:
lvl0 a b
lvl1 bar foo bah foo
A0 B0 C0 D0 1 0 3 ... | |
pandas_user_guide/howtospeeduppythonpa_72_0.txt | [  | |
pandas_user_guide/pandas_user_guide_27_31.txt | HTTP/1.1
2 Request Method: GET
3 Request URI: /notes/request/
4 Request Query: NaN,
0 Accept-Encoding: identity
1 Host: www.sump.org
2 User-Agent: Python-urllib/3.8
3 Conn... | |
pandas_user_guide/howtospeeduppythonpa_40_0.txt | 3.66 s ± 119 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) | |
pandas_user_guide/pandas_user_guide_18_4.txt | hmetic with a MultiIndex that needs broadcasting
](https://stackoverflow.com/questions/19501510/divide-entire-pandas-
multiindex-dataframe-by-dataframe-variable/19502176#19502176)
In [74]: cols = pd.MultiIndex.from_tuples(
....: [(x, y) for x in ["A", "B", "C"] for y in ["O", "I"]]
....... | |
pandas_user_guide/pandas_user_guide_5_17.txt | 2
Here [ ` transform() `
](../reference/api/pandas.DataFrame.transform.html#pandas.DataFrame.transform
"pandas.DataFrame.transform") received a single function; this is equivalent
to a [ ufunc ](https://numpy.org/doc/stable/reference/ufuncs.html)
application.
In [188]: np.abs(tsdf)
Out[188]:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.