Output Issues with pandas, Python
Begin Code import pandas as pd df = pd.read_csv('C:/Users/lhicks/Documents/Corporate/test.csv', 'r') saved_column = df.FirstName saved_column2 = df.LastName saved_column3 = df.Email print saved_column print saved_column2 print saved_column3 Itemlist =  Itemlist.append(saved_column) print Itemlist End of Code The objective is to select specific columns from a specified xls sheet, grab all the rows from the specified columns, and then print that data out. The current issue is the data is grabbed correctly, but after 29-30 rows, it prints/stores a "...", and then jumps to line item 880s, and finishes out from there. The additional issue is that it also stores this as the value, making it worthless due to not providing the full dataset. The eventual process is to add the selected columns to a new xls sheet to clean up the old data, and then add the rows to a templated document to generate an advertisement letter. The first question is how to I have all the fields populate? The second is what is the best approach for this? Please provide additional links as well if possible, this is a practical learning experience for me.
Pandas tries to shorten your data when printing it. NOTE: all the data is still there (print(df.shape) - to check it, print the shape of your DataFrame), it's just a convenient way not to flood your screen with tons of data rows/columns Try this: fn = 'C:/Users/lhicks/Documents/Corporate/test.csv' cols = ['FirstName','LastName','Email'] df = pd.read_csv(fn, usecols=cols) df.to_excel('/path/to/excel.xlsx', index=False) This will parse only ['FirstName','LastName','Email'] columns from a CSV file and will export them to Excel file UPDATE: if you want to control how many rows should Pandas print: with pd.option_context("display.max_rows",200): print(df)
giving a name to a pandas dataframe?
mistake comparing datetime, python
numpy testing assert array NOT equal
How to join threads of an asyncio executor runned inside coroutine?
Google Admin SDK insert custom schema using python
Importing images for manifold Isomap
Having nosetests watch files from outside container and rerun tests inside container
Trying to ftp from my system to remote server
Attribute in a Class immediately runs at the wrong time?
Unable to handle “HTTP Badstatus line” exception
How to merge/join two resultset/table in django?
Maximise the Slope using CVXPY
Python-Instagram user_recent_media returning next of none
Django - AttributeError: 'module' object has no attribute 'admin'
Convert pandas (python) categorical x-axis to continuous values when plotting
How to make a specific type of python face tracker