Created
June 11, 2021 11:03
-
-
Save nithyadurai87/b0e136ad8dc13be234fb0bf43f973a70 to your computer and use it in GitHub Desktop.
This file contains 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
import pandas as pd | |
df = pd.read_csv("./girls.csv") | |
print (df.shape) | |
print (df.columns) | |
print (df['fname']) # df.fname , df['fname','age'] | |
print (df.loc[ 1:4 , 'fname' ]) | |
print (df.loc[ [1,4] , 'fname' ]) | |
print (df.loc[ : , 'age']>30 ) | |
print (df.ix[1:4, 'fname' ]) | |
print (df.ix[[1,4], 'fname' ]) | |
print (df.ix[ : , 'age']>30 ) | |
print (df.iloc[1:4,1:4]) | |
print (df.iloc[[1,4],[1,4]]) | |
print (df.iloc[[1,4],lambda x : [1,4]]) | |
print (pd.get_option("display.max_rows")) # max_columns | |
pd.set_option("display.max_rows",5) # reset_option() | |
pd.set_option("display.max_columns",4) # reset_option() | |
print (df) | |
pd.reset_option("display.max_rows") | |
pd.reset_option("display.max_columns") | |
print (pd.describe_option("display.max_rows")) | |
with pd.option_context("display.max_rows",5): | |
print (df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment