user125221
0
Q:

delimiter pandas

Pandas provide a method to split string around a passed separator/delimiter. After that, the string can be stored as a list in a series or it can also be used to create multiple column data frames from a single separated string.
1
# importing Pandas library 
import pandas as pd 
  
pd.read_csv(filepath_or_buffer = "pokemon.csv") 
  
# makes the passed rows header 
pd.read_csv("pokemon.csv", header =[1, 2]) 
  
# make the passed column as index instead of 0, 1, 2, 3.... 
pd.read_csv("pokemon.csv", index_col ='Type') 
  
# uses passed cols only for data frame 
pd.read_csv("pokemon.csv", usecols =["Type"]) 
  
# reutruns pandas series if there is only one colunmn 
pd.read_csv("pokemon.csv", usecols =["Type"], 
                              squeeze = True) 
                                
# skips the passed rows in new series 
pd.read_csv("pokemon.csv", 
            skiprows = [1, 2, 3, 4]) 
5

New to Communities?

Join the community