Search
Search Results
Search finished, found 66 page(s) matching the search query.
- pandas.core.groupby.DataFrameGroupBy.head (Python method, in pandas.core.groupby.DataFrameGroupBy.head)
- pandas.core.groupby.SeriesGroupBy.head (Python method, in pandas.core.groupby.SeriesGroupBy.head)
- pandas.DataFrame.head (Python method, in pandas.DataFrame.head)
- pandas.Series.head (Python method, in pandas.Series.head)
- Essential basic functionality
...x=["a", "b", "c", "d", "e"]) In [3]: df = pd.DataFrame(np.random.randn(8, 3), index=index, columns=["A", "B", "C"]) Head and tail To view a small sample of a Series or DataFrame object, use the head() and tail() methods. The default num...
- pandas.core.groupby.DataFrameGroupBy.head
pandas.core.groupby.DataFrameGroupBy.head DataFrameGroupBy.head(n=5)[source] Return first n rows of each group. Similar to .apply(lambda x: x.head(n)), but it returns a subset of rows from the original DataFrame wit...
- pandas.core.groupby.SeriesGroupBy.head
pandas.core.groupby.SeriesGroupBy.head SeriesGroupBy.head(n=5)[source] Return first n rows of each group. Similar to .apply(lambda x: x.head(n)), but it returns a subset of rows from the original DataFrame with orig...
- pandas.DataFrame.head
pandas.DataFrame.head DataFrame.head(n=5)[source] Return the first n rows. This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type...
- pandas.Series.head
pandas.Series.head Series.head(n=5)[source] Return the first n rows. This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of dat...
- 10 minutes to pandas
...ributes have been truncated for brevity. Viewing data See the Essentially basics functionality section. Use DataFrame.head() and DataFrame.tail() to view the top and bottom rows of the frame respectively: In [13]: df.head() Out[13]:...
- Categorical data
...n range(0, 100, 10)] In [8]: df["group"] = pd.cut(df.value, range(0, 105, 10), right=False, labels=labels) In [9]: df.head(10) Out[9]: value group 0 65 60 - 69 1 49 40 - 49 2 56 50 - 59 3 43 40 - 49 4 43 40...
- Community tutorials
...orials Pandas From The Ground Up (2015) (2:24) GitHub repo Introduction Into Pandas (2016) (1:28) GitHub repo Pandas: .head() to .tail() (2016) (1:26) GitHub repo Data analysis in Python with pandas (2016-2018) GitHub repo and Jupyter Note...
- Comparison with R / R libraries
...common R operations using dplyr with pandas equivalents. Querying, filtering, sampling R pandas dim(df) df.shape head(df) df.head() slice(df, 1:10) df.iloc[:9] filter(df, col1 == 1, col2 == 1) df.query('col1 == 1 & col2 == 1') df[...
- Comparison with SAS
...ead tab delimited, and did not have column names, the pandas command would be: tips = pd.read_csv("tips.csv", sep="\t", header=None) # alternatively, read_table is an alias to read_csv with tab delimiter tips = pd.read_table("tips.csv", he...
- Comparison with spreadsheets
...Data structures General terminology translation pandas Excel DataFrame worksheet Series column Index row headings row row NaN empty cell DataFrame A DataFrame in pandas is analogous to an Excel worksheet. While an Exce...
- Comparison with SQL
...ew York City 3 1 Boston 4 2 Los Angeles 5 LIMIT SELECT * FROM tips LIMIT 10; In [36]: tips.head(10) Out[36]: total_bill tip sex smoker day time size 0 16.99 1.01 Female No Sun Dinner...
- Comparison with Stata
...es, and existed in the current working directory, the pandas command would be: tips = pd.read_csv("tips.csv", sep="\t", header=None) # alternatively, read_table is an alias to read_csv with tab delimiter tips = pd.read_table("tips.csv", he...
- Contributing to the code base
...one of the following: pre-commit run --files <files you have modified> pre-commit run --from-ref=upstream/main --to-ref=HEAD --all-files without needing to have done pre-commit install beforehand. Finally, we also have some slow pre-commi...
- Cookbook
...port itertools In [86]: index = list(itertools.product(["Ada", "Quinn", "Violet"], ["Comp", "Math", "Sci"])) In [87]: headr = list(itertools.product(["Exams", "Labs"], ["I", "II"])) In [88]: indx = pd.MultiIndex.from_tuples(index, names=...
- Duplicate Labels
...dex=["a", "b"]).set_flags(allows_duplicate_labels=False) In [30]: s1 Out[30]: a 0 b 0 dtype: int64 In [31]: s1.head().rename({"a": "b"}) --------------------------------------------------------------------------- DuplicateLabelErro...
- Group by: split-apply-combine
....prod gb.resample gb.sum gb.var gb.apply gb.cummax gb.cumsum gb.fillna gb.gender gb.head gb.indices gb.mean gb.name gb.ohlc gb.quantile gb.size gb.tail gb.weight...
- How do I create plots in pandas?
...In [3]: air_quality = pd.read_csv("data/air_quality_no2.csv", index_col=0, parse_dates=True) In [4]: air_quality.head() Out[4]: station_antwerp station_paris station_london datetime...
- How do I read and write tabular data?
...0 NaN Q [891 rows x 12 columns] I want to see the first 8 rows of a pandas DataFrame. In [4]: titanic.head(8) Out[4]: PassengerId Survived Pclass ... Fare Cabin Embarked 0 1 0 3 ......
- How do I select a subset of a
DataFrame
? - How to calculate summary statistics
- How to combine data from multiple tables
- How to create new columns derived from existing columns
- How to handle time series data with ease
- How to manipulate textual data
- How to reshape the layout of tables
- Intro to data structures
- pandas docstring guide
- pandas.core.groupby.SeriesGroupBy.nlargest
- pandas.core.groupby.SeriesGroupBy.nsmallest
- pandas.DataFrame.groupby
- pandas.DataFrame.memory_usage
- pandas.DataFrame.nlargest
- pandas.DataFrame.nsmallest
- pandas.DataFrame.tail
- pandas.Series.groupby
- pandas.Series.nlargest
- pandas.Series.nsmallest
- pandas.Series.tail
- Scaling to large datasets
- Sparse data structures
- Table Visualization
- Time series / date functionality
- User Guide
- Using Gitpod for pandas development
- Version 0.13.0 (January 3, 2014)
- Version 0.14.0 (May 31 , 2014)
- Version 0.15.1 (November 9, 2014)
- Version 0.16.0 (March 22, 2015)
- Version 0.16.1 (May 11, 2015)
- Version 0.18.0 (March 13, 2016)
- Version 0.19.0 (October 2, 2016)
- Version 0.20.1 (May 5, 2017)
- Version 0.21.0 (October 27, 2017)
- Version 0.6.0 (November 25, 2011)
- What’s new in 0.25.0 (July 18, 2019)
- What’s new in 1.0.0 (January 29, 2020)
- What’s new in 1.2.0 (December 26, 2020)
- What’s new in 1.4.0 (January 22, 2022)
- What’s new in 2.0.0 (April 3, 2023)
- What’s new in 2.1.0 (Aug 30, 2023)
- Windowing operations