Created
September 10, 2019 06:01
-
-
Save vikas-git/c6bcd408e6239f30384d5aaebb00d6bd to your computer and use it in GitHub Desktop.
Some tricks of pandas for working more fast
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://towardsdatascience.com/10-python-pandas-tricks-that-make-your-work-more-efficient-2e8e483808ba | |
pd.read_csv('file_name.csv', nrows = 5, usecols=['c1', 'c2'], dtype = {‘c1’: str, ‘c2’: int, …}) | |
argument | |
* nrows = 5 (it will select only 5 rows from dataframe) | |
* usecols (select certain columns on df creation) | |
* dtype (specify col data type) | |
* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment