BUG: not correct work str.split (original) (raw)
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of pandas.
- I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
import pandas as pd
df = pd.DataFrame(columns=['url']) df['url'] = ['https://qweqwe.com/2021-09-14/qweqwejpgqweqwe.jpg'] df['id'] = df['url'].str.split('/').str[-2].astype(str) + '_' + df['url'].str.split('/').str[-1].str.split('.jpg').str[0] print(df['id'].iloc[0])
Issue Description
output: 2021-09-14_qweqw
true output: 2021-09-14_qweqwejpgqweqwe
Expected Behavior
2021-09-14_qweqwejpgqweqwe
Installed Versions
python 3.9
pandas version 1.3.2