Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Data Extraction in Python

df['c'] = df['transaction_descriptor'].apply(lambda x: (df[df['transaction_descriptor'].str.contains(x)]['store_number']))[0]
for index,row in df.loc[df['c'].isna(),:].iterrows():
    test_=df.loc[index,'store_number']
    test=df.loc[index,'transaction_descriptor']
    result=[s for s in test.split() if str(test_) in s]
    
    df.loc[index,'c']=result
Comment

PREVIOUS NEXT
Code Example
Python :: Compress multiple directories but exclude directory - Python zipfile(or anything native to Windows 2012+ 
Python :: find smallest element not present in list python 
Python :: list average python recursion 
Python :: how to check all possible combinations algorithm python 
Python :: inherit variables of parent 
Python :: ternary operator in list comprehension python 
Python :: dimensions of dataset in python 
Python :: pyqt serial plotter 
Python :: how do i access individual elements of matrix in python? 
Python :: django assign authenticated user to foreign user 
Python :: python pyramid pattern 
Python :: if space bar pressed pygame 
Python :: how to make a typing effect in python 
Python :: EDA dataframe get missing and zero values 
Python :: postgres fecth python 
Python :: ring Using Lists during definition 
Python :: store image in django postprocessimage in django storage 
Python :: python graph 
Python :: equivalent of geom smooth function in python using plotline lib 
Python :: open file find and replace commas python 
Python :: how to execute more than one line of code in one line python 
Python :: pandas count zeros in column 
Python :: seleniu get element value and store it in a variable - selenium remember user 
Python :: legend outside subplot not displayed 
Python :: commanding ip camera(onvif-ptz-control-python) 
Python :: easygui text adventure in python 3 
Python :: scikitlearndecisiontree 
Python :: displays unique data including null data 
Python :: aw mustard 
Python :: df.isna percentage 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =