Example #1
0
def PandasCSVWrite():
    df = pandas.readCSV('tgs.csv',
                        index_col='NPM',
                        parse_dates=['Tanggal Lahir'],
                        header=0,
                        names=['NPM', 'Nama', 'Kelas', 'Tanggal Lahir'])
    df.to_csv('tgs5.csv')
Example #2
0
                          and region = 'US' ''') #(select max(trovo_asof) from [Pricing_BankLoans].[Main].[DailyInputTable])
 
 print("SQL Done")
 
 newDaily = open(glob(r'\\xsqnfs2.nyc.ime.reuters.com\TRPS\Bank Loans\Auto 2.0\Algo\Input\D*.csv')[0], 'w', newline='')
 writeDaily = csv.writer(newDaily)
 
 header = ['Concatenated', 'unchanged_for', 'days_stale'] #defining header for daily file
 writeDaily.writerow(header)
 
 for row in SQLNavigator:
     writeDaily.writerow(row)
     
 newDaily.close()
 
 hierarchyFile = readCSV(glob(r'\\xsqnfs2.nyc.ime.reuters.com\TRPS\Bank Loans\Auto 2.0\Algo\Input\B*.csv')[0]) #dealer hierarchy
 
 trovoFiles = glob(r'\\xsqnfs2.nyc.ime.reuters.com\TRPS\Bank Loans\Auto 2.0\Trovo\mw-set*.csv')
 trovoFiles.sort(key=path.getmtime, reverse = True)
     
 trovoFile = readCSV(trovoFiles[0]) #most recent trovo file  
 dailyFile = readCSV(glob(r'\\xsqnfs2.nyc.ime.reuters.com\TRPS\Bank Loans\Auto 2.0\Algo\Input\D*.csv')[0]) #yesterday's dailyInputFile
 
 print("merge started")
 
 cleanFile = merge(trovoFile, dailyFile) #file after merging data and killing stale quotes
 
 print("select started")
 
 cleanFile = select(cleanFile, hierarchyFile) #file after selections are made
 
Example #3
0
def bukaModeListPandas():
    df = pandas.readCSV('tgs.csv')
    print(df)
Example #4
0
def ubahNamaKolom():
    df = pandas.readCSV('tugas.csv')
    df.columns = ['Col_1', 'Col_2', 'Col_3', 'Col_4']
    print(df)
Example #5
0
def ClmIdxChng():
    df = pandas.readCSV('tugas.csv')
    df.index = ['Row_1', 'Row_2']
    print(df)
Example #6
0
def ubahFormatTanggal():
    df = pandas.readCSV('tgs.csv', parse_dates=['tanggal lahir'])
    print(df)
import pandas as pd

df = pd.readCSV('buddymove_holidayiq.csv')
print(df.head())