Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python extract thefile name from relative path

import os
infile = "./../../../../_data/matrix_data/5mer_normalized.tsv"
print(os.path.basename(infile))
>>> "5mer_normalized.tsv"
Comment

PREVIOUS NEXT
Code Example
Python :: how to import data from csv to jupyter notebook 
Python :: print complete dataframe pandas 
Python :: pyodbc ms access 
Python :: how to import matplotlib.pyplo in python 
Python :: python module with alphabet list 
Python :: python read from txt file 
Python :: python change a key in a dictionary 
Python :: pandas absolute value 
Python :: list loop python 
Python :: how to plotting horizontal bar on matplotlib 
Python :: get first element of ordereddict 
Python :: redirect to previous page django 
Python :: drop row based on NaN value of a column 
Python :: python enumerate start at 1 
Python :: how to count number of unique values in a column python 
Python :: pandas summarize all columns 
Python :: full screen jupyter notebook 
Python :: python string cut substring 
Python :: norm complex numpy 
Python :: matplotlib bar chart value_counts 
Python :: accessing dictionary elements in python 
Python :: how to copy one dictionary to another in python 
Python :: pil python 
Python :: bot ping discord.py 
Python :: python add to list with index 
Python :: global keyword python 
Python :: django staff_member_required decorator 
Python :: while not equal python 
Python :: encrypt string python 
Python :: del keyword in python 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =