inspect first 5 rows of dataframe 1

inspect first 5 rows of dataframe

#df.head(#rows)
dataframe.head(n=rows)

Here is what the above code is Doing:
1. We’re importing the pandas library and giving it the alias pd.
2. We’re importing the numpy library and giving it the alias np.
3. We’re creating a variable called dataframe and assigning it to the result of the read_csv() function.
4. We’re creating a variable called rows and assigning it to the value 10.
5. We’re using the head() function to display the first 10 rows of the dataframe.

Similar Posts