\n",
+ "\n",
+ "### Machine learning crash course\n",
+ "\n",
+ "
\n",
+ "\n",
+ "These are a few of the notebooks from Google's online machine learning course. See the
full course website for more.\n",
+ "- [Intro to Pandas DataFrame](https://colab.research.google.com/github/google/eng-edu/blob/main/ml/cc/exercises/pandas_dataframe_ultraquick_tutorial.ipynb)\n",
+ "- [Linear regression with tf.keras using synthetic data](https://colab.research.google.com/github/google/eng-edu/blob/main/ml/cc/exercises/linear_regression_with_synthetic_data.ipynb)\n",
+ "\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "### Using accelerated hardware\n",
+ "
\n",
+ "\n",
+ "- [TensorFlow with GPUs](/notebooks/gpu.ipynb)\n",
+ "- [TensorFlow with TPUs](/notebooks/tpu.ipynb)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "P-H6Lw1vyNNd"
+ },
+ "source": [
+ "
\n",
+ "\n",
+ "
\n",
+ "\n",
+ "### Featured examples\n",
+ "\n",
+ "
\n",
+ "\n",
+ "-
NeMo voice swap: Use Nvidia NeMo conversational AI toolkit to swap a voice in an audio fragment with a computer-generated one.\n",
+ "\n",
+ "-
Retraining an Image Classifier: Build a Keras model on top of a pre-trained image classifier to distinguish flowers.\n",
+ "-
Text Classification: Classify IMDB film reviews as either
positive or
negative.\n",
+ "-
Style Transfer: Use deep learning to transfer style between images.\n",
+ "-
Multilingual Universal Sentence Encoder Q&A: Use a machine-learning model to answer questions from the SQuAD dataset.\n",
+ "-
Video Interpolation: Predict what happened in a video between the first and the last frame.\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "name": "Welcome to Colaboratory",
+ "toc_visible": true,
+ "provenance": [],
+ "include_colab_link": true
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "name": "python3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
\ No newline at end of file
From 70b67f988ffdff907488a4293daadae6b43115b9 Mon Sep 17 00:00:00 2001
From: victor8818 <64544696+victor8818@users.noreply.github.com>
Date: Sun, 17 Dec 2023 18:09:28 +1030
Subject: [PATCH 2/2] Created using Colaboratory
---
Python_Excel.ipynb | 769 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 769 insertions(+)
create mode 100644 Python_Excel.ipynb
diff --git a/Python_Excel.ipynb b/Python_Excel.ipynb
new file mode 100644
index 00000000..e03e4d26
--- /dev/null
+++ b/Python_Excel.ipynb
@@ -0,0 +1,769 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 0,
+ "metadata": {
+ "colab": {
+ "provenance": [],
+ "authorship_tag": "ABX9TyPwXacEJ0rx9mTgT0ulwzYo",
+ "include_colab_link": true
+ },
+ "kernelspec": {
+ "name": "python3",
+ "display_name": "Python 3"
+ },
+ "language_info": {
+ "name": "python"
+ }
+ },
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ "

"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "id": "i0laOf4CgY1i"
+ },
+ "outputs": [],
+ "source": [
+ "import numpy as np\n",
+ "import pandas as pd"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# **Chapter 4**"
+ ],
+ "metadata": {
+ "id": "hiUDf1aypobT"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# matrix = [[1,2,3],\n",
+ "# [4,5,6],\n",
+ "# [7,8,9]\n",
+ "\n",
+ "# ]\n",
+ "# [[i+1 for i in row] for row in matrix]\n",
+ "\n",
+ "array1 = np.array([10,100,1000.])\n",
+ "array2 = np.array([[1.,2.,3.],\n",
+ " [4.,5.,6.]])\n",
+ "array1.dtype\n",
+ "#numpy 对于同一list要求type相同,即使,arrary1[0]和[1]是整数,也会转换为float\n",
+ "array2@array2.T\n",
+ "np.sqrt(array2)\n",
+ "np.ones((5,2))"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "ZgFvdRGBgfdx",
+ "outputId": "a60fbaf3-da40-40cc-845e-2eeadd8e7529"
+ },
+ "execution_count": 13,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "array([[1., 1.],\n",
+ " [1., 1.],\n",
+ " [1., 1.],\n",
+ " [1., 1.],\n",
+ " [1., 1.]])"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 13
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# **Chapter 5 Pandas**"
+ ],
+ "metadata": {
+ "id": "t9Hr_Ptpp7E2"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "DataFrame 与二维数组类似,但是有自己的header"
+ ],
+ "metadata": {
+ "id": "dDWmhHwNqHQ-"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "pd.read_excel('../content/course_participants.xlsx')"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 175
+ },
+ "id": "PK2d1KtLpU0E",
+ "outputId": "78524005-b242-4dea-94d9-24bd06347f01"
+ },
+ "execution_count": 17,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ " user_id name age country score continent\n",
+ "0 1001 Mark 55 Italy 4.5 Europe\n",
+ "1 1000 John 33 USA 6.7 America\n",
+ "2 1002 Tim 41 USA 3.9 America\n",
+ "3 1003 Jenny 12 Germany 9.0 Europe"
+ ],
+ "text/html": [
+ "\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " user_id | \n",
+ " name | \n",
+ " age | \n",
+ " country | \n",
+ " score | \n",
+ " continent | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 1001 | \n",
+ " Mark | \n",
+ " 55 | \n",
+ " Italy | \n",
+ " 4.5 | \n",
+ " Europe | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 1000 | \n",
+ " John | \n",
+ " 33 | \n",
+ " USA | \n",
+ " 6.7 | \n",
+ " America | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 1002 | \n",
+ " Tim | \n",
+ " 41 | \n",
+ " USA | \n",
+ " 3.9 | \n",
+ " America | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 1003 | \n",
+ " Jenny | \n",
+ " 12 | \n",
+ " Germany | \n",
+ " 9.0 | \n",
+ " Europe | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 17
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "data = [[\"Mark\",55,\"Italy\",4.5,\"Europe\"],\n",
+ " [\"John\",33,\"USA\",6.7,\"America\"],\n",
+ " [\"Tim\",41,\"USA\",3.9,\"America\"],\n",
+ " [\"Jenny\",12,\"Germany\",9.0,\"Eurpope\"]\n",
+ "\n",
+ "]\n",
+ "df = pd.DataFrame(data=data,\n",
+ " columns = [\"Name\",\"Age\",\"Country\",\"Score\",\"Continent\"],\n",
+ " index = [1001,1002,1003,1004])\n",
+ "df.info() #DataFrame的数据类型\n",
+ "df.dtypes #DataFrame列的数据类型\n",
+ "df.index #获取index对象\n",
+ "df.index.name = \"Use_ID\" #给index命名\n",
+ "df.reset_index() #重设index,将user的index还原为一般列,加入默认index\n",
+ "df.reset_index().set_index('Name') #链式调用,将names设定为新的index"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 414
+ },
+ "id": "OtB_4CUpq8AU",
+ "outputId": "94121299-e628-474d-e95d-1c6eec532cc5"
+ },
+ "execution_count": 35,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "
\n",
+ "Int64Index: 4 entries, 1001 to 1004\n",
+ "Data columns (total 5 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 Name 4 non-null object \n",
+ " 1 Age 4 non-null int64 \n",
+ " 2 Country 4 non-null object \n",
+ " 3 Score 4 non-null float64\n",
+ " 4 Continent 4 non-null object \n",
+ "dtypes: float64(1), int64(1), object(3)\n",
+ "memory usage: 192.0+ bytes\n"
+ ]
+ },
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ " Use_ID Age Country Score Continent\n",
+ "Name \n",
+ "Mark 1001 55 Italy 4.5 Europe\n",
+ "John 1002 33 USA 6.7 America\n",
+ "Tim 1003 41 USA 3.9 America\n",
+ "Jenny 1004 12 Germany 9.0 Eurpope"
+ ],
+ "text/html": [
+ "\n",
+ " \n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Use_ID | \n",
+ " Age | \n",
+ " Country | \n",
+ " Score | \n",
+ " Continent | \n",
+ "
\n",
+ " \n",
+ " | Name | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | Mark | \n",
+ " 1001 | \n",
+ " 55 | \n",
+ " Italy | \n",
+ " 4.5 | \n",
+ " Europe | \n",
+ "
\n",
+ " \n",
+ " | John | \n",
+ " 1002 | \n",
+ " 33 | \n",
+ " USA | \n",
+ " 6.7 | \n",
+ " America | \n",
+ "
\n",
+ " \n",
+ " | Tim | \n",
+ " 1003 | \n",
+ " 41 | \n",
+ " USA | \n",
+ " 3.9 | \n",
+ " America | \n",
+ "
\n",
+ " \n",
+ " | Jenny | \n",
+ " 1004 | \n",
+ " 12 | \n",
+ " Germany | \n",
+ " 9.0 | \n",
+ " Eurpope | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 35
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file