id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
pandas_user_guide/vectorizationinpanda_59_0.txt
While this code works, it processes each element individually in a loop, which can be slow for large datasets.
pandas_user_guide/howtospeeduppythonpa_106_0.txt
[ ](https://www.facebook.com/sharer/sharer.php?u=https://www.exxactcorp.com/blog/Deep- Learning/how-to-speed-up-python-pandas-by-over-300x)
pandas_user_guide/pandas_user_guide_3_8.txt
....: In [88]: df Out[88]: A B C D 0 foo one 1.346061 -1.577585 1 bar one 1.511763 0.396823 2 foo two 1.627081 -0.105381 3 bar three -0.990582 -0.532532 4 foo two -0.441652 1.453749 5 bar two 1.211526 1.208843 6 f...
pandas_user_guide/pandas_user_guide_26_9.txt
index") DataFrame function to achieve the same result as the column names are stored in the resulting ` MultiIndex ` , although this will make an extra copy. In [99]: df.groupby(["A", "B"]).agg("sum").reset_index() Out[99]: A B C D 0 bar one 0.254161 1.511763...
pandas_user_guide/howtospeeduppythonpa_167_0.txt
April 24, 2024 12 min read ](/blog/deep-learning/ollama-open-source-llms- anywhere)
pandas_user_guide/pandas_user_guide_25_26.txt
11-01-03'], dtype='datetime64[ns]', freq=None) In [360]: idx2.fillna(pd.Timestamp('2011-01-02')) Out[360]: DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03'], dtype='datetime64[ns]', freq=None) ## Set / reset index # Occasionally you will load or create a data set into a DataFrame and want t...
pandas_user_guide/howtospeeduppythonpa_94_0.txt
April 24, 2024 12 min read ](/blog/deep-learning/ollama-open-source-llms- anywhere)
pandas_user_guide/howtospeeduppythonpa_130_0.txt
### Looping/Iterating
pandas_user_guide/howtospeeduppythonpa_173_0.txt
##### Deep Learning
pandas_user_guide/vectorizationinpanda_27_0.txt
# Example 1: Basic Arithmetic Operations
pandas_user_guide/pandas_user_guide_27_17.txt
see you",5 In [186]: pd.read_csv(StringIO(data), escapechar="\\") Out[186]: a b 0 hello, "Bob", nice to see you 5 ### Files with fixed width columns # While [ ` read_csv() ` ](../reference/api/pandas.read_csv.html#pandas.read_csv "pandas.read_csv") reads...
pandas_user_guide/pandas_user_guide_11_10.txt
ted by Python. [ __ previous Options and settings ](options.html "previous page") [ next Scaling to large datasets __ ](scale.html "next page") __ On this page * Cython (writing C extensions for pandas) * Pure Python * Plain Cython * Declaring C types * Using ndarray * Disabling compile...
pandas_user_guide/pandas_user_guide_9_4.txt
9859 two 2.143608 foo one 1.443110 two -1.413542 qux one NaN two NaN dtype: float64 In [36]: s + s[::2] Out[36]: bar one -1.723698 two NaN baz one -0.989859 two NaN foo one 1.443110 ...
pandas_user_guide/pandas_user_guide_26_4.txt
) In [52]: grouped.sum() Out[52]: first bar -0.962232 baz 1.237723 foo 0.785980 qux 1.911055 dtype: float64 If the MultiIndex has names specified, these can be passed instead of the level number: In [53]: s.groupby(level="second").sum() Out[53]: ...
pandas_user_guide/pandas_user_guide_25_24.txt
36 a 5 3.082764 In [309]: df3[~df3.index.duplicated(keep=False)] Out[309]: a b c 3 -0.894409 ## Dictionary-like [ ` get() ` ](../reference/api/pandas.DataFrame.get.html#pandas.DataFrame.get "pandas.DataFrame.get") method # Each of Series or DataFrame have a ` get ` met...
pandas_user_guide/tutorialbasicvectori_19_0.txt
Skip to main content [ LinkedIn ](/?trk=article-ssr-frontend-pulse_nav- header-logo)
pandas_user_guide/pandasvectorization_38_0.txt
Out[65]:
pandas_user_guide/howtospeeduppythonpa_34_0.txt
## Which Pandas Code Is Fastest: Looping, Apply, or Vectorization?
pandas_user_guide/pandas_user_guide_27_52.txt
2000-01-02 -0.080372 -1.268121 1.561967 2000-01-03 0.816983 1.965656 -1.169408 2000-01-04 0.712795 -0.062433 0.736755 2000-01-05 -0.298721 -1.988045 1.475308 2000-01-06 1.103675 1.382242 -0.650762 2000-01-07 -0.729161 -0.142928 -1.063038 2000-01-08 -1.005977 0.465222 -0.094517 GRO...
pandas_user_guide/pandas_user_guide_17_2.txt
[32]: s - datetime.datetime(2011, 1, 1, 3, 5) Out[32]: 0 364 days 20:55:00 1 365 days 20:55:00 2 366 days 20:55:00 dtype: timedelta64[ns] In [33]: s + datetime.timedelta(minutes=5) Out[33]: 0 2012-01-01 00:05:00 1 2012-01-02 00:05:00 2 2012-01-03 00:05:00 ...
pandas_user_guide/pandas_user_guide_27_36.txt
3schools.com/xml/books.xml") In [377]: df Out[377]: category title author year price cover 0 cooking Everyday Italian Giada De Laurentiis 2005 30.00 None 1 children Harry Potter J K. Rowling 2005 29.99 None 2...
pandas_user_guide/pandas_user_guide_27_33.txt
splay(HTML(html)) <IPython.core.display.HTML object> The ` columns ` argument will limit the columns shown: In [348]: html = df.to_html(columns=[0]) In [349]: print(html) <table border="1" class="dataframe"> <thead> <tr style="text-align: right;"> <th></th>...
pandas_user_guide/pandas_user_guide_27_54.txt
0.343197 baz two -1.646063 -0.695847 -0.429156 three -0.244688 -1.428229 -0.138691 qux one 1.866184 -1.446617 0.036660 two -1.660522 0.929553 -1.298649 three 3.565769 0.682402 1.041927 # the levels are automatically included as data columns In [512]: store.selec...
pandas_user_guide/pandasvectorization_36_0.txt
In [65]:
pandas_user_guide/howtospeeduppythonpa_80_0.txt
#### Topics
pandas_user_guide/pandas_user_guide_2_34.txt
` ](https://docs.python.org/3/library/datetime.html#datetime.timezone "\(in Python v3.12\)") objects from the standard library. ### Working with time zones # By default, pandas objects are time zone unaware: In [434]: rng = pd.date_range("3/6/2012 00:00", periods=15, freq="D") In [435]: rng...
pandas_user_guide/vectorizationinpanda_24_0.txt
# What is Vectorization?
pandas_user_guide/vectorizationinpanda_40_0.txt
# Example 3: Conditional Operations
pandas_user_guide/pandas_user_guide_27_40.txt
10]: geom_df = pd.DataFrame( .....: { .....: "shape": ["square", "circle", "triangle"], .....: "degrees": [360, 360, 180], .....: "sides": [4, np.nan, 3], .....: } .....: ) .....: In [411]: print(geom_df.to_xml()) <?xml versi...
pandas_user_guide/pandas_user_guide_22_3.txt
ther uses are not supported, and may be disabled at a later point. ## Splitting and replacing strings # Methods like ` split ` return a Series of lists: In [38]: s2 = pd.Series(["a_b_c", "c_d_e", np.nan, "f_g_h"], dtype="string") In [39]: s2.str.split("_") Out[39]: 0 [a, b, c] ...
pandas_user_guide/vectorizationinpanda_34_0.txt
Vectorization also allows you to apply custom functions to columns. Suppose you want to calculate the square of each element in a column:
pandas_user_guide/tutorialbasicvectori_17_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_auth- button_user-agreement) , [ Privacy Policy ](/legal/privacy-policy?trk=article- ssr-frontend-pulse_auth-button_privacy-policy) , and [ Cookie Policy ](/legal/cookie-policy?trk=ar...
pandas_user_guide/pandas_user_guide_4_2.txt
astype("category") In [23]: df_cat.dtypes Out[23]: A category B category dtype: object This conversion is likewise done column by column: In [24]: df_cat["A"] Out[24]: 0 a 1 b 2 c 3 a Name: A, dtype: category Categories (3, ob...
pandas_user_guide/pandas_user_guide_12_4.txt
nable CoW # Copy-on-Write can be enabled through the configuration option ` copy_on_write ` . The option can be turned on __globally__ through either of the following: In [65]: pd.set_option("mode.copy_on_write", True) In [66]: pd.options.mode.copy_on_write = True [ __ previous MultiInd...
pandas_user_guide/vectorizationinpanda_107_0.txt
## Written by Gaurav Kumar
pandas_user_guide/howtospeeduppythonpa_43_0.txt
The ‘apply' function effectively does the same thing as the loop. It will create a new column titled reward and apply the calculation function every 1 row as defined by 'axis=1’. The 'Apply' function is a faster way to run a loop to your dataset.
pandas_user_guide/pandas_user_guide_20_1.txt
s.Series.explode") : Convert a column of list-like values to individual rows. * [ ` crosstab() ` ](../reference/api/pandas.crosstab.html#pandas.crosstab "pandas.crosstab") : Calculate a cross-tabulation of multiple 1 dimensional factor arrays. * [ ` cut() ` ](../reference/api/pandas.cut.html#pandas.cut "panda...
pandas_user_guide/pandas_user_guide_5_6.txt
e tools shown above, you might imagine using ` (df + df == df * 2).all() ` . But in fact, this expression is False: In [57]: df + df == df * 2 Out[57]: one two three a True True False b True True True c True True True d False True True In...
pandas_user_guide/pandas_user_guide_14_6.txt
t of dataclasses is equivalent to passing a list of dictionaries. Please be aware, that all values in the list should be dataclasses, mixing types in the list would result in a ` TypeError ` . In [65]: from dataclasses import make_dataclass In [66]: Point = make_dataclass("Point", [("x", int),...
pandas_user_guide/pandas_user_guide_15_1.txt
.: for i in range(10) ...: ] ...: In [5]: ts_wide = pd.concat(timeseries, axis=1) In [6]: ts_wide.head() Out[6]: id_0 name_0 x_0 ... name_9 x_9 y_9 timestamp ... ...
pandas_user_guide/pandas_user_guide_16_4.txt
a": "b"}) File ~/work/pandas/pandas/pandas/core/series.py:5081, in Series.rename(self, index, axis, copy, inplace, level, errors) 5074 axis = self._get_axis_number(axis) 5076 if callable(index) or is_dict_like(index): 5077 # error: Argument 1 to "_rename" of "NDFrame" has incompati...
pandas_user_guide/pandasvectorization_3_0.txt
* [ C++ Control Flow ](/cpp/control-flow/) * [ C++ Functions ](/cpp/functions/) * Octave * [ Mac OSX Setup ](/octave-mac-setup/) * [ Introductory Octave for Machine Learning ](/octave-introduction-machine-learning/)
pandas_user_guide/pandas_user_guide_2_6.txt
....: datetime.datetime(2012, 5, 3), ....: ] ....: # Note the frequency information In [71]: index = pd.DatetimeIndex(dates) In [72]: index Out[72]: DatetimeIndex(['2012-05-01', '2012-05-02', '2012-05-03'], dtype='datetime64[ns]', freq=None) # Automatically conve...
pandas_user_guide/tutorialbasicvectori_78_0.txt
To view or add a comment, [ sign in ](https://www.linkedin.com/signup/cold- join?session_redirect=%2Fpulse%2Ftutorial-basic-vectorization-pandas-iterrows- apply-duc-lai-trung-minh-75d4c%2F&trk=article-ssr-frontend-pulse_x-social- details_feed-cta-banner-cta)
pandas_user_guide/pandas_user_guide_23_3.txt
A is unknown, it is ambiguous to convert NA to a boolean value. In [45]: bool(pd.NA) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[45], line 1 ----> 1 bool(pd.NA) Fil...
pandas_user_guide/howtospeeduppythonpa_88_0.txt
##### Deep Learning
pandas_user_guide/pandas_user_guide_27_46.txt
[ setting the config options ](options.html#options) ` io.excel.xlsx.writer ` and ` io.excel.xls.writer ` . pandas will fall back on [ openpyxl ](https://openpyxl.readthedocs.io/) for ` .xlsx ` files if [ Xlsxwriter ](https://xlsxwriter.readthedocs.io) is not available. To specify which writer you want to use, you...
pandas_user_guide/pandas_user_guide_24_17.txt
66995 | 0.646086 | 0.486899 | 1.022196 | -2.267827 | -1.229616 | 1.313805 | 1.073292 | 2.324940 | -0.542720 | -1.504292 | 0.777643 | -0.618553 | 0.011342 | 1.385062 | 1.363552 | -0.549834 | 0.688896 | 1.361288 | -0.381137 | 0.797812 | -1.128198 | 0.369208 | 0.540132 | 0.4...
pandas_user_guide/howtospeeduppythonpa_123_0.txt
Now that we have our dataset and our parameters for what we want to return, we can go ahead and explore the fastest way to execute this type of analysis.
pandas_user_guide/pandas_user_guide_3_4.txt
ition # See more in [ Selection by Position ](indexing.html#indexing-integer) using [ ` DataFrame.iloc() ` ](../reference/api/pandas.DataFrame.iloc.html#pandas.DataFrame.iloc "pandas.DataFrame.iloc") or [ ` DataFrame.iat() ` ](../reference/api/pandas.DataFrame.iat.html#pandas.DataFrame.iat "pandas.DataFrame.iat") ...
pandas_user_guide/pandasvectorization_9_0.txt
In [50]:
pandas_user_guide/pandas_user_guide_27_6.txt
conversion in pandas. For instance, you can use the ` converters ` argument of [ ` read_csv() ` ](../reference/api/pandas.read_csv.html#pandas.read_csv "pandas.read_csv") : In [17]: data = "col_1\n1\n2\n'A'\n4.22" In [18]: df = pd.read_csv(StringIO(data), converters={"col_1": str}) ...
pandas_user_guide/pandas_user_guide_17_3.txt
9:57') In [62]: -1 * td1 Out[62]: Timedelta('1 days 02:00:03') In [63]: -td1 Out[63]: Timedelta('1 days 02:00:03') In [64]: abs(td1) Out[64]: Timedelta('1 days 02:00:03') ## Reductions # Numeric reduction operation for ` timedelta64[ns] ` will return ` Timedelta ` object...
pandas_user_guide/howtospeeduppythonpa_69_0.txt
##### Deep Learning
pandas_user_guide/tutorialbasicvectori_27_0.txt
[ Duc Lai Trung Minh ](https://vn.linkedin.com/in/henryduclai?trk=article- ssr-frontend-pulse_publisher-author-card)
pandas_user_guide/pandasvectorization_34_0.txt
Out[64]:
pandas_user_guide/howtospeeduppythonpa_39_0.txt
This is what it returned:
pandas_user_guide/vectorizationinpanda_49_0.txt
Vectorization in Pandas offers several benefits:
pandas_user_guide/pandas_user_guide_17_6.txt
98 5 days 03:00:00 99 Freq: h, Length: 100, dtype: int64 Selections work similarly, with coercion on string-likes and slices: In [106]: s["1 day":"2 day"] Out[106]: 1 days 00:00:00 0 1 days 01:00:00 1 1 days 02:00:00 2 1 days 03:00:00 3 1 days ...
pandas_user_guide/pandas_user_guide_3_9.txt
A 0.339969 0.884345 B -0.693205 1.591431 ### Pivot tables # See the section on [ Pivot Tables ](reshaping.html#reshaping-pivot) . In [101]: df = pd.DataFrame( .....: { .....: "A": ["one", "one", "two", "three"] * 3, .....: "B": ["A", "B...
pandas_user_guide/vectorizationinpanda_108_0.txt
](https://gaurav-adarshi.medium.com/?source=post_page----- 3a4fda08a184--------------------------------)
pandas_user_guide/pandas_user_guide_18_9.txt
es", .....: "yes", .....: "yes", .....: "yes", .....: "no", .....: "yes", .....: "yes", .....: "yes", .....: "yes", .....: "yes", .....: ...
pandas_user_guide/howtospeeduppythonpa_7_0.txt
* [ Return to Homepage ](/)
pandas_user_guide/pandasvectorization_14_0.txt
# index index = ['a', 'b', 'c', 'd']
pandas_user_guide/pandas_user_guide_3_10.txt
tseries.offsets.BusinessDay") ) to a time series: In [113]: rng Out[113]: DatetimeIndex(['2012-03-06', '2012-03-07', '2012-03-08', '2012-03-09', '2012-03-10'], dtype='datetime64[ns]', freq='D') In [114]: rng + pd.offsets.BusinessDay(5) Out[114]: ...
pandas_user_guide/tutorialbasicvectori_38_0.txt
2. Vectorization
pandas_user_guide/howtospeeduppythonpa_64_0.txt
[ Configure Now ](/category/Deep-Learning-AI-Servers)
pandas_user_guide/tutorialbasicvectori_73_0.txt
` ` ` `
pandas_user_guide/vectorizationinpanda_70_0.txt
# Create two NumPy arrays and two lists for the comparison array1 = np.random.randint(1, 100, size=1000000) array2 = np.random.randint(1, 100, size=1000000) list1 = list(array1) list2 = list(array2)
pandas_user_guide/howtospeeduppythonpa_183_0.txt
[ Contact us today chevron_right ](/Contact-Us)
pandas_user_guide/howtospeeduppythonpa_163_0.txt
March 7, 2024 9 min read ](/blog/Deep-Learning/managing-python-dependencies- with-poetry-vs-conda-pip)
pandas_user_guide/howtospeeduppythonpa_79_0.txt
April 11, 2024 7 min read ](/blog/deep-learning/sxm-vs-pcie-gpus-best-for- training-llms-like-gpt-4)
pandas_user_guide/vectorizationinpanda_46_0.txt
Output: A D 0 1 Odd 1 2 Even 2 3 Odd
pandas_user_guide/pandas_user_guide_9_18.txt
------- KeyError Traceback (most recent call last) File ~/work/pandas/pandas/pandas/core/indexes/base.py:3805, in Index.get_loc(self, key) 3804 try: -> 3805 return self._engine.get_loc(casted_key) 3806 except KeyError as err: File index.pyx:167, in...
pandas_user_guide/pandas_user_guide_17_1.txt
ith datetime.timedelta conventions In [10]: pd.Timedelta("-1us") Out[10]: Timedelta('-1 days +23:59:59.999999') # a NaT In [11]: pd.Timedelta("nan") Out[11]: NaT In [12]: pd.Timedelta("nat") Out[12]: NaT # ISO 8601 Duration strings In [13]: pd.Timedelta("P0DT0H1M0S") ...
pandas_user_guide/vectorizationinpanda_93_0.txt
# In Plain English
pandas_user_guide/pandas_user_guide_5_23.txt
names: In [253]: df = pd.DataFrame( .....: {"col1": np.random.randn(3), "col2": np.random.randn(3)}, index=["a", "b", "c"] .....: ) .....: In [254]: for col in df: .....: print(col) .....: col1 col2 pandas objects also have the dict-like...
pandas_user_guide/pandas_user_guide_9_5.txt
one 1.431256 -0.076467 0.875906 two 1.340309 -1.187678 -2.211372 Passing a list of labels or tuples works similar to reindexing: In [47]: df.loc[[("bar", "two"), ("qux", "one")]] Out[47]: A B C first second ...
pandas_user_guide/pandas_user_guide_2_19.txt
` is a mixture of ` BusinessHour ` and ` CustomBusinessDay ` which allows you to specify arbitrary holidays. ` CustomBusinessHour ` works as the same as ` BusinessHour ` except that it skips specified custom holidays. In [228]: from pandas.tseries.holiday import USFederalHolidayCalendar In ...
pandas_user_guide/pandas_user_guide_24_3.txt
e can view these by calling the [ .to_html() ](../reference/api/pandas.io.formats.style.Styler.to_html.html) method, which returns the raw HTML as string, which is useful for further processing or adding to a file - read on in More about CSS and HTML . This section will also provide a walkthrough for how to convert t...
pandas_user_guide/pandas_user_guide_9_6.txt
foo bah foo A1 B0 C1 D0 73 72 75 74 D1 77 76 79 78 C3 D0 89 88 91 90 D1 93 92 95 94 B1 C1 D0 105 104 107 106 ... ... ... ... ... A3 B0 C3 D1 221 220 223 222 B1 C1 D0 233 232 235 234 D1 2...
pandas_user_guide/pandas_user_guide_9_12.txt
[127]: ser = pd.Series(np.random.randn(10)) In [128]: ser.iloc[positions] Out[128]: 0 -0.179666 9 1.824375 3 0.392149 dtype: float64 In [129]: ser.take(positions) Out[129]: 0 -0.179666 9 1.824375 3 0.392149 dtype: float64 For DataFrames,...
pandas_user_guide/pandas_user_guide_9_2.txt
Out[11]: MultiIndex([('bar', 'one'), ('bar', 'two'), ('foo', 'one'), ('foo', 'two')], names=['first', 'second']) As a convenience, you can pass a list of arrays directly into ` Series ` or ` DataFrame ` to construct a ` MultiIndex ` automati...
pandas_user_guide/vectorizationinpanda_68_0.txt
Certainly! Let’s compare the time it takes to perform element-wise addition using NumPy’s vectorized approach and a traditional loop-based approach in Python. We’ll use the ` timeit ` module to measure the execution time of both methods. Here's the code for the comparison:
pandas_user_guide/vectorizationinpanda_97_0.txt
[ Vectorization ](https://medium.com/tag/vectorization?source=post_page----- 3a4fda08a184---------------vectorization-----------------)
pandas_user_guide/vectorizationinpanda_51_0.txt
# **Vectorization: How it speeds up your code**
pandas_user_guide/pandas_user_guide_8_6.txt
In [55]: result Out[55]: key1 key2 A B C D 0 K0 K0 A0 B0 C0 D0 1 K0 K1 A1 B1 NaN NaN 2 K1 K0 A2 B2 C1 D1 3 K1 K0 A2 B2 C2 D2 4 K2 K0 NaN NaN C3 D3 5 K2 K1 A3 B3 NaN NaN ![../_images/mer...
pandas_user_guide/tutorialbasicvectori_42_0.txt
6. Conclusion
pandas_user_guide/vectorizationinpanda_128_0.txt
Terms
pandas_user_guide/pandas_user_guide_24_29.txt
fices to summarize the key points: A CSS importance score for each HTML element is derived by starting at zero and adding: * 1000 for an inline style attribute * 100 for each ID * 10 for each attribute, class or pseudo-class * 1 for each element name or pseudo-element Let’s use this to describe the ...
pandas_user_guide/vectorizationinpanda_9_0.txt
# Vectorization in Pandas: Simplifying Data Operations
pandas_user_guide/howtospeeduppythonpa_98_0.txt
April 11, 2024 7 min read ](/blog/deep-learning/sxm-vs-pcie-gpus-best-for- training-llms-like-gpt-4)
pandas_user_guide/vectorizationinpanda_130_0.txt
Text to speech
pandas_user_guide/pandas_user_guide_26_3.txt
# In order to allow NaN in keys, set ``dropna`` to False In [32]: df_dropna.groupby(by=["b"], dropna=False).sum() Out[32]: a c b 1.0 2 3 2.0 2 5 NaN 1 4 The default setting of ` dropna ` argument is ` True ` which means ` NA ` are not included in group keys. ...
pandas_user_guide/pandas_user_guide_2_13.txt
the date times in [ ` DatetimeIndex ` ](../reference/api/pandas.DatetimeIndex.html#pandas.DatetimeIndex "pandas.DatetimeIndex") were spaced when using [ ` date_range() ` ](../reference/api/pandas.date_range.html#pandas.date_range "pandas.date_range") * the frequency of a [ ` Period ` ](../reference/api/pandas.Pe...
pandas_user_guide/pandas_user_guide_24_13.txt
.bar(align=0, vmin=-2.5, vmax=2.5, cmap="bwr", height=50, width=60, props="width: 120px; border-right: 1px solid black;")\ .text_gradient(cmap="bwr", vmin=-2.5, vmax=2.5) [57]: | A | B | C | D ---|---|---|---|--- 0 | 1.764 | 0.400 | |...
pandas_user_guide/tutorialbasicvectori_6_0.txt
Sign in
pandas_user_guide/howtospeeduppythonpa_13_0.txt
![EXX-Blog-how-to-speed-up- pandas.jpg](https://images.contentstack.io/v3/assets/blt71da4c740e00faaa/blt1a2447171af231d4/63dc0c0a842f040f19e3e750/EXX- Blog-how-to-speed-up-pandas.jpg?format=webp)
pandas_user_guide/vectorizationinpanda_117_0.txt
](https://help.medium.com/hc/en-us?source=post_page----- 3a4fda08a184--------------------------------)
pandas_user_guide/pandas_user_guide_22_5.txt
In [74]: s.str.cat(["A", "B", "C", "D"]) Out[74]: 0 aA 1 bB 2 cC 3 dD dtype: string Missing values on either side will result in missing values in the result as well, _unless_ ` na_rep ` is specified: In [75]: s.str.cat(t) Out[75]: 0 aa ...