python:pandas
This is an old revision of the document!
Pandas
Refers to Panel Data, and Python Data Analysis.
Fundamental concepts are pd.DataFrame and pd.Series
Always imported as pd: import pandas as pd
Tightly coupled to numpy.
DataFrame
A DataFrame is like a table, where each row is a Series. A DataFrame identify each row with an index, which defaults to 0..n. Same with the columns.
Indexing
import pandas as pd tabledata = {'name' :['George', 'Frank', 'John'],\ 'surname' :['Jungle', 'Sinatra', 'Wick',\ 'mail' :['jg@jg.com', 'fs@gmail.com', 'wick@burnt.co.uk']} df = pd.DataFrame(tabledata)
inplace
Most operations (?) creates a new dataset unless the property inplace=true in function calls.
df.set_index('mail', inplace=True)
python/pandas.1628190543.txt.gz · Last modified: 2022/09/12 00:30 (external edit)
