Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the best way to get the first five entries of a data frame?

Answer Posted / glibwaresoftsolutions

You can use the `.head()` method in pandas to get the first five rows of a DataFrame:
python
import pandas as pd
df = pd.DataFrame({'a': [1, 2, 3, 4, 5, 6]})
first_five = df.head(5)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to minimize the memcached server outages in your python development?

928


How can you prevent dogpile effect?

750


In which field python is used?

794


What are the types of functions in python?

990


What are key words in python?

798


What type of language is python? Programming or scripting?

769


Which database is best for python?

824


How to count the occurrences of a perticular element in the list?

906


Why are tuples immutable?

833


Explain what is a flask? What are its benefits?

751


Explain tkinter in python

824


Can I create apps with python?

756


What is the meaning of stdin in python?

857


Will python work multiple inheritance?

825


How to convert a numpy array to a python list?

869