Programming Principles in Python (CSCI 503/490)
Programming Principles in Python (CSCI 503/490)
Visualization
Dr. David Koop
D. Koop, CSCI 503/490, Fall 2021
Derived Data
? Create new columns from existing columns
- r["PctFail"] = r['Fail'] / r['Total']
? Note that operations are computed in a vectorized manner ? Similarities to functional paradigm (map/ lter):
- specify the operation once - no loops - interpreted as an operation on the entire column
D. Koop, CSCI 503/490, Fall 2021
2
if
producing a new value. Finally, the results of all those function applications are combined into a result object. The form of the resulting object will usually depend on what's
Aggregbeaingtidoonne :toSthepdlaitta-. SAeepFipgulrye 9--C1 foor ma mbockinupeof a simple group aggregation.
D. Koop, CSCI 5F0i3g/u4r9e0,9F-1a.llI2ll0u2s1tration of a group aggregation
[W. McKinney, Python for Data Analysis]
3
Split-Apply-Combine
? df.groupby('Island')[['Culmen Length (mm)', 'Culmen Depth (mm)']].mean()
? df.groupby('Island').agg({'Culmen Length (mm)': 'mean', 'Culmen Depth (mm)': 'mean'})
? df.groupby('Island').agg( cul_length=('Culmen Length (mm)', 'mean'), cul_depth=('Culmen Depth (mm)', 'mean'))
D. Koop, CSCI 503/490, Fall 2021
4
Melt
? Want to keep each observation separate (tidy), aka pivot_longer
df.melt(id_vars=["location", "Temperature"], var_name="Date", value_name="Value")
D. Koop, CSCI 503/490, Fall 2021
[AB Abhi]
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- reading raster data with gdal
- how to create columns openoffice
- i have a csv file and need to assign a data type to each
- pandas
- reading and writing data files with python
- python pandas cbse class xi class xii
- pandas dataframe notes
- program list python dataframe for practical file program
- programming principles in python csci 503 490
- authors the teachers at edu
Related searches
- financial management principles in healthcare
- financial management principles in health
- financial principles in healthcare
- finance principles in health care
- adult learning principles in nursing
- ethical principles in the workplace
- 7 ethical principles in nursing
- personal principles in life
- ethical principles in nursing definitions
- 4 ethical principles in medicine
- basic ethical principles in research
- basic ethical principles in business