Détails
19 avril 2024
65507
Index de l'article
Data management with Python, Pandas, Geopandas, Matplotlib and Openpyxl
Read/export data file (CSV, Excel, MySQL, Postgres, JSON, Shape ...)
Get dataframe from lists
Work with lists
Advanced read/write in Excel
Advanced write in a TXT file
Advanced read in a TXT file
Merge, concatenate, append
Analyze data from a multi-valued field
Work with dates
Work with phones
Pie chart
Bar chart
Work with shapefiles
Geopandas
Joins
Group, count and sort
Replace, remove, edit with conditions
Search
Extract
Filters
Split
Warnings
Miscellaneous
Migrations
Toutes les Pages
Page 20 sur 25
Extract a specific string # Delete what is before SpecificString
df[ 'NewField' ] = df[ 'OldField' ] .replace ( { '.*(?=SpecificString)' : '' } , regex= True )
# Delete what is after SpecificString
df[ 'NewField' ] = df[ 'NewField' ] .replace ( { '(?<=SpecificString).*' : '' } , regex= True ) Extract names from email from email_decomposer.EmailDecomposer import EmailDecomposer
email_decomposer = EmailDecomposer( )
df[ [ 'first_name' , 'last_name' , 'host' ] ] = df[ 'email' ] .apply (
lambda x: pd.Series ( email_decomposer.decompose ( data= x, get_host= True ) ) )