python Programming Glossary: pd.read_csv
Parse dates when YYYYMMDD and HH are in separate columns using pandas in Python http://stackoverflow.com/questions/11615504/parse-dates-when-yyyymmdd-and-hh-are-in-separate-columns-using-pandas-in-python pandas as pd parse lambda x datetime.strptime x ' Y m d H' pd.read_csv .. file.csv parse_dates 'YYYYMMDD' 'HH' index_col 0 date_parser..
float64 with pandas to_csv http://stackoverflow.com/questions/12877189/float64-with-pandas-to-csv a dataframe and write this dataframe to a new place df pd.read_csv orig df.to_csv pandasfile Now this pandasfile has Bob 0.085000000000000006..
Selecting columns from pandas.HDFStore table http://stackoverflow.com/questions/13926089/selecting-columns-from-pandas-hdfstore-table with the following code tmp pd.HDFStore 'test.h5' chunker pd.read_csv 'cars.csv' iterator True chunksize 10 names 'make' 'model' 'drop'..
Heatmap in matplotlib with pcolor? http://stackoverflow.com/questions/14391959/heatmap-in-matplotlib-with-pcolor page urlopen http datasets.flowingdata.com ppg2008.csv nba pd.read_csv page index_col 0 # Normalize data columns nba_norm nba nba.mean..
How to trouble-shoot HDFStore Exception: cannot find the correct atom type http://stackoverflow.com/questions/15488809/how-to-trouble-shoot-hdfstore-exception-cannot-find-the-correct-atom-type In 30 store pd.HDFStore 'test0.h5' 'w' In 31 for chunk in pd.read_csv 'Train.csv' chunksize 10000 .... store.append 'df' chunk index.. 21.0 Metric Tons However when I drop this column from the pd.read_csv chunks and append to my HDFStore I still get the same Exception... I get the following new exception In 6 for chunk in pd.read_csv 'Train.csv' header 0 chunksize 50000 ... for col in chunk.columns..
Read Specific Columns from csv file with Python csv http://stackoverflow.com/questions/16503560/read-specific-columns-from-csv-file-with-python-csv an entire column into a variable import pandas as pd df pd.read_csv csv_file saved_column df.column_name #you can also use df 'column_name'..
Pandas group by operations on a data frame http://stackoverflow.com/questions/16684346/pandas-group-by-operations-on-a-data-frame 2 55 ... 2 41 ... 2 5 ... 3 78 ... 1 25 ... 3 1 In 4 df pd.read_csv StringIO data sep ' s ' In 5 grouped df.groupby 'UsrId' In 6..
Parsing DD MM YY HH MM SS columns from TXT file using Python's pandas http://stackoverflow.com/questions/17301589/parsing-dd-mm-yy-hh-mm-ss-columns-from-txt-file-using-pythons-pandas just to parse the dates them when reading the csv In 1 df pd.read_csv '0132_3.TXT' header None sep ' s s' parse_dates 0 In 2 df Out.. '20 s s s s s s' year month day hour min sec In 12 df pd.read_csv '0132_3.TXT' header None sep ' s s' parse_dates 0 date_parser..
Using numpy.genfromtxt to read a csv file with strings containing commas http://stackoverflow.com/questions/17933282/using-numpy-genfromtxt-to-read-a-csv-file-with-strings-containing-commas ... 2012 Louisville KY 3.5 ... 2011 Lexington KY 4.0 In 4 pd.read_csv StringIO s quotechar ' ' skipinitialspace True Out 4 year city..
Numpy loading csv TOO slow compared to Matlab http://stackoverflow.com/questions/18259393/numpy-loading-csv-too-slow-compared-to-matlab user 25.7 s sys 28 ms total 25.8 s Wall time 25.8 s time d pd.read_csv . test.csv delimiter .values CPU times user 740 ms sys 36 ms..
|