Review of Python Courses (Part 7)
Posted by Mark on December 7, 2020 at 07:19 | Last modified: January 25, 2021 11:26In Part 6, I summarized my Datacamp courses 16-18. Today I will continue with the next three.
As a reminder, I introduced you to my recent work learning Python here.
My course #19 was Manipulating DataFrames with pandas. This course covers:
- Indexing DataFrames (using square brackets, using .loc, using .iloc, selecting certain columns with [[ ]] )
- Slicing DataFrames (R boundary included with .loc but not .iloc, slicing with one/two brackets gets Series/df)
- Filtering DataFrames
- Transforming DataFrames [vectorized computations in numpy without loops, .map() for index, .apply() for Series]
- Indexed objects and labeled data (name attribute for index and columns attributes)
- Hierarchical indexing (sorting MultiIndex)
- Pivoting DataFrames [.pivot(index= , columns= , values= ) ]
- Stacking and unstacking DataFrames (pivoting doesn’t work well on MultiIndex so unstack to move index to column)
- Melting DataFrames [reverses .pivot() ]
- Pivot tables
- Categoricals and groupby
- Groupby and aggregation/transformation
- Iterating over and filtering groupby object
- Understanding the column labels
- .idxmax() and .idxmin() (row/column label where max/min value located)
- .T attribute (transposes numpy array)
- Reshaping DataFrames for visualization
- Making a histogram (bins, range, normalizing)
>
My twentieth course was Manipulating Time Series Data in Python. This course has lots of good information for backtesting:
- How to use dates and times with pandas ( [sequences of] timestamp and period objects)
- Indexing and resampling time series [selecting missing ‘price’ values, .asfreq() ]
- Lags, changes, and returns for stock price series [.shift(), n-period % chg, .diff(), .pct_change(), stock price chg in df]
- Compare time series growth rates ( .iloc as abs ref, normalizing series, concat prices and .dropna, perf vs. benchmark)
- Changing the time series frequency: resampling
- Upsampling and interpolation with .resample()
- Downsampling and aggregation (plotting resample data with ax)
- Rolling window functions with pandas (plotting price and moving average, plotting multiple rolling metrics)
- Expanding window functions with pandas (calculating running return, running rate of return)
- Relationships between time series: correlation
- Select index components and import data
- Build a market-cap weighted index
- Evaluate index performance
- Index correlation and exporting to Excel
>
My course #21 was Working with Dates and Times in Python. This course covers:
- Dates in Python
- Math with dates (time delta)
- Turning dates into strings
- Adding time to the mix
- Printing and parsing datetimes (no time printed from datetime object)
- Working with durations
- UTC offsets
- Time zone database (from dateutil import tz)
- Starting Daylight Saving Time
- Ending Daylight Saving Time [ .datetime_ambiguous() and .enfold() for ambiguous times]
- Reading date and time data in Pandas (loading datetimes with parse_dates [or manually with .to_datetime() ])
- Summarizing datetime data in Pandas (alternative to for loop)
- Additional datetime methods in Pandas
- Index correlation and exporting to Excel
>
No comments posted.