2023-02-16 16:11:54 +08:00
{
"cells": [
{
"cell_type": "code",
2023-02-20 18:17:44 +08:00
"execution_count": 1,
2023-02-16 16:11:54 +08:00
"metadata": {},
2023-02-18 18:44:26 +08:00
"outputs": [
2023-05-15 10:42:16 +08:00
{
"name": "stdout",
"output_type": "stream",
"text": [
" OLS Regression Results \n",
"==============================================================================\n",
"Dep. Variable: Revenue_Log R-squared: 0.586\n",
"Model: OLS Adj. R-squared: 0.580\n",
"Method: Least Squares F-statistic: 94.86\n",
"Date: Sat, 01 Apr 2023 Prob (F-statistic): 1.85e-14\n",
"Time: 18:07:54 Log-Likelihood: -128.58\n",
"No. Observations: 69 AIC: 261.2\n",
"Df Residuals: 67 BIC: 265.6\n",
"Df Model: 1 \n",
"Covariance Type: nonrobust \n",
"==================================================================================\n",
" coef std err t P>|t| [0.025 0.975]\n",
"----------------------------------------------------------------------------------\n",
"Intercept 14.3160 0.806 17.757 0.000 12.707 15.925\n",
"Num_Employ_Log 0.9728 0.100 9.740 0.000 0.773 1.172\n",
"==============================================================================\n",
"Omnibus: 55.594 Durbin-Watson: 1.958\n",
"Prob(Omnibus): 0.000 Jarque-Bera (JB): 244.671\n",
"Skew: 2.451 Prob(JB): 7.42e-54\n",
"Kurtosis: 10.815 Cond. No. 34.6\n",
"==============================================================================\n",
"\n",
"Notes:\n",
"[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
"['1', '1.1', '1.2', '1.3', '1.4', '2', '1.1.1', '1.1.2', '1.1.3', '1.2.1', '1.2.2', '1.2.3', '1.3.1', '1.3.2', '1.3.3', '1.3.4', '1.3.5', '1.4.1', '1.4.2', '1.4.3', '1.4.4', '1.4.5', '2.1', '2.2', '2.3', '1.3.1.1', '1.3.1.2', '1.3.1.3', '1.3.1.4', '1.3.1.5', '1.3.1.6', '1.3.1.7', '1.3.2.1', '1.3.3.1', '1.3.3.2', '1.3.3.3', '1.3.3.4', '1.3.3.5', '1.3.3.6', '1.3.3.7', '1.3.4.1', '1.3.4.2', '1.3.4.3', '1.3.5.1', '1.4.1.1', '1.4.1.2', '1.4.1.3', '1.4.1.4', '1.4.1.5', '1.4.2.1', '1.4.2.2', '1.4.2.3', '1.4.2.4', '1.4.2.5', '1.4.2.6', '1.4.2.7', '1.4.3.1', '1.4.3.2', '1.4.3.3', '1.4.3.4', '1.4.3.5', '1.4.3.6', '1.4.4.1', '1.4.4.2', '1.4.4.3', '1.4.4.4', '1.4.4.5', '1.4.5.1', '1.4.5.2', '1.4.5.3', '1.4.5.4', '1.4.5.5', '1.4.5.6', '1.4.5.7', '1.4.5.8', '1.4.5.9', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.3.1', '2.3.2', '2.3.3', '2.1.1.1', '2.1.1.2', '2.1.1.3', '2.1.1.4', '2.1.1.5', '2.1.2.1', '2.1.2.2', '2.1.2.3', '2.1.2.4', '2.1.3.1', '2.1.3.2', '2.1.3.3', '2.1.3.4', '2.1.3.5', '2.1.3.6', '2.1.3.7', '2.1.4.1', '2.1.4.2', '2.1.4.1.1', '2.1.4.1.2', '2.1.4.1.3', '2.1.4.1.4', '2.1.4.2.1', '2.1.4.2.2']\n"
]
},
2023-02-18 18:44:26 +08:00
{
"name": "stderr",
"output_type": "stream",
"text": [
2023-05-15 10:42:16 +08:00
"C:\\Users\\ASUS\\AppData\\Local\\Temp\\ipykernel_17316\\1464358194.py:49: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
2023-02-18 18:44:26 +08:00
" Firm_copy.insert(Firm_copy.columns.get_loc('Revenue'),'Revenue_Log', series_Revenue_Log)\n",
2023-05-15 10:42:16 +08:00
"C:\\Users\\ASUS\\AppData\\Local\\Temp\\ipykernel_17316\\1464358194.py:51: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
2023-02-18 18:44:26 +08:00
" Firm_copy.insert(Firm_copy.columns.get_loc('Num_Employ'),'Num_Employ_Log', series_Num_Employ_Log)\n"
]
2023-05-15 10:42:16 +08:00
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAi0AAAGvCAYAAACXeeU8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB650lEQVR4nO3deXxU9b0//tc5s2YyM9kXQhLIwhYWV5CCCghWrmKFatVKq6JWREVcettb9V71flu0vda6VKBqrUu1ra3i9rNVZHNFRAFZUiAJS9izzj5zZuac3x9DYk7WyWTW5PV8PPJocyZz5hOCzCuf5f0WFEVRQERERJTkxEQPgIiIiCgcDC1ERESUEhhaiIiIKCUwtBAREVFKYGghIiKilMDQQkRERCmBoYWIiIhSAkMLERERpQSGFiIiIkoJCQktb731FsrLy6HVanHOOeeguroaAPDyyy+jtLQUZrMZc+bMwYEDBxIxPCIiIkpCQrzL+NfW1mLy5MlYtWoVZsyYgaVLl+LIkSN46aWXMGvWLLz55pvIzc3FQw89hNraWmzYsCGs+8qyjKNHj8JisUAQhNh+E0RERBQViqLA4XCgqKgIotjHXIoSZ++8846ycuXK9s/XrVun6PV65e9//7vygx/8oP36xx9/rAwbNizs+9bX1ysA+MEPfvCDH/zgRwp+1NfX9/ler0WczZs3T/X5nj17UFlZiaqqKqxbtw5bt25FeXk5nn76aVx44YVh39disQAA6uvrYbVaozpmIiIiig273Y6SkpL29/HexD20dCRJEh599FHcddddqKqqwhVXXIEzzzwTAFBWVoYvvviix+f6fD74fL72zx0OBwDAarUytBAREaWYcLZ2JPT00P333w+z2Yybb74ZmzZtwjvvvIMvvvgCDocDP/zhD3HxxRdD6WHLzcMPP4yMjIz2j5KSkjiPnoiIiOIp7htx26xZswaXX345Nm3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YR0pgo53YQgIBRq9je6odeKUa+I25/3b1bEJSIiSgGtbglPrq2B61TdlLZjyAatgFyzHo1OCa9ursdpJZkQBQGjC8193rOteJz7VAiyngpBdaeK0bWFIFEQMLbQgpJsU6y/zV5xTwsREVESC8oKjtu82FTbjEM91U2JoA5L1+JxIkRB6LEY3ZaDzXjmo9qof3/9wZkWIiKiJOXyBdDo9CEoK+11U6w91E3RawQ4+lGHpdficR1C0Jf7W/D+ruPYsLcBogCcW5mHqjieGOqIMy1ERERJRpYVnHR4ccLuRfBUmfy+6qb0tw5LX8XjdCLgkAJ44J1d2LC3ITQuBXjw7V1I1HZYhhYiIqIk4vUHcaTVA6c3oLrea92UCOqw9BaC3FIAh1o88EgypIDcfv30kkz897wqCGEem442hhYiIqIkoCgKml0SjrZ64A/KXR6Pdh2W7kJQICjjmM2Lw61eVZixGrX42UVj8MaSaZhYnBGdbzgC3NNCRESUYFJAxkmHVzWr0Z0zSrNw94Wj248oO07VYSnPM/dah6U7bSHosTV70eDwAYIAu8ePjk2bBQCXTBqGG88tQ67ZENdCct1haCEiIkogm8ePZpcU9j6RM0qzcFpJZth1WPq614IzhuOPnxyAx69ejirOSsMv/mMsxg1LntpnDC1EREQJEJQVNDp9cPkCfX9xJ+HWYelNi1vCMx/V4f1dJ1TXTXoNfnJeGeZNKoImwTMrnTG0EBERxZlHCqLB4UNA7n05KBaCsoJ3th/F858egLNTYPqPCYX4yXllyIxj5+b+YGghIiKKIllWsOuoHc1uqUvJe1lW0OyWYPf4EzK23UfteGLtPuw76VRdr8hLx7LZozBheOI22YaDoYWIiChKPqtpxMqNtag96YQ/GKqB0tZc8IzSLDQ6fd2eDIo
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2023-02-18 18:44:26 +08:00
}
],
2023-02-16 16:11:54 +08:00
"source": [
"import pandas as pd\n",
2023-02-18 16:46:38 +08:00
"import numpy as np\n",
2023-02-18 18:44:26 +08:00
"import math\n",
"import statsmodels.formula.api as smf\n",
2023-02-18 16:46:38 +08:00
"from sklearn.preprocessing import MinMaxScaler\n",
2023-02-16 16:11:54 +08:00
"import networkx as nx\n",
"import matplotlib.pyplot as plt\n",
2023-02-18 18:44:26 +08:00
"import seaborn as sns\n",
2023-02-16 16:11:54 +08:00
"\n",
"plt.rcParams['font.sans-serif'] = 'SimHei'\n",
"\n",
2023-02-18 18:44:26 +08:00
"# init graph bom\n",
2023-02-16 16:11:54 +08:00
"BomNodes = pd.read_csv('BomNodes.csv', index_col=0)\n",
"BomNodes.set_index('Code', inplace=True)\n",
"BomCateNet = pd.read_csv('BomCateNet.csv', index_col=0)\n",
"BomCateNet.fillna(0, inplace=True)\n",
"\n",
"G = nx.from_pandas_adjacency(BomCateNet, create_using=nx.MultiDiGraph())\n",
"\n",
"labels_dict = {}\n",
"for code in G.nodes:\n",
" labels_dict[code] = BomNodes.loc[code].to_dict()\n",
2023-02-18 18:44:26 +08:00
"nx.set_node_attributes(G, labels_dict)\n",
"\n",
"# load firm\n",
"Firm = pd.read_csv(\"Firm.csv\")\n",
"Firm_copy = Firm.copy()\n",
"\n",
2023-02-20 18:17:44 +08:00
"# add attribute, number of firm, to graph bom\n",
"firm_num_dict = {}\n",
"for node in nx.nodes(G):\n",
" firm_num_dict[node]= sum(Firm_copy[node]==1)\n",
"nx.set_node_attributes(G, firm_num_dict, name=\"Num_Firm\")\n",
"\n",
2023-02-18 18:44:26 +08:00
"# get log revenue\n",
"Firm_copy['Revenue_Log'] = Firm_copy['Revenue'].map(math.log)\n",
"Firm_copy['Num_Employ_Log'] = Firm_copy['Num_Employ'].map(math.log)\n",
"data_ols = Firm_copy[Firm_copy[['Revenue_Log', 'Num_Employ_Log']].notnull().all(axis=1)][['Revenue_Log', 'Num_Employ_Log']]\n",
"\n",
"ols_model = smf.ols('Revenue_Log ~ Num_Employ_Log', data=data_ols)\n",
"ols_results = ols_model.fit()\n",
"b = ols_results.params.Intercept\n",
"a = ols_results.params.Num_Employ_Log\n",
2023-05-15 10:42:16 +08:00
"print(ols_results.summary())\n",
"sns.regplot(x='Num_Employ_Log',y='Revenue_Log',data=data_ols[data_ols.notnull().all(axis=1)])\n",
2023-02-18 18:44:26 +08:00
"\n",
"Firm_copy.loc[Firm_copy['Revenue_Log'].isnull(), 'Revenue_Log'] = Firm_copy[Firm_copy['Revenue_Log'].isnull()]['Num_Employ_Log'].map(lambda x: a*x + b)\n",
"series_Revenue_Log = Firm_copy.pop('Revenue_Log')\n",
"Firm_copy.insert(Firm_copy.columns.get_loc('Revenue'),'Revenue_Log', series_Revenue_Log)\n",
"series_Num_Employ_Log = Firm_copy.pop('Num_Employ_Log')\n",
"Firm_copy.insert(Firm_copy.columns.get_loc('Num_Employ'),'Num_Employ_Log', series_Num_Employ_Log)\n",
"\n",
"# lift firm from neighboring tier\n",
2023-02-20 17:40:26 +08:00
"node_list = list(nx.bfs_tree(G, '1'))\n",
"node_list.reverse()\n",
2023-02-20 18:17:44 +08:00
"\n",
"# init criterion for ending the lifting process\n",
"node_check = [k for k, v in nx.get_node_attributes(G, 'Num_Firm').items() if v==0]\n",
"if '1' in node_check:\n",
" node_check.remove('1')\n",
"for node in node_check:\n",
" if G.out_degree(node) == 0:\n",
" node_check.remove(node)\n",
" print(f\"Warning: node, {node}, in tier 0 does not contain firm\")\n",
"\n",
"while node_check:\n",
" for node in node_list[:-1]:\n",
" if G.out_degree(node) > 0 and sum(Firm_copy[node]==1) == 0:\n",
" list_neighbors = list(G.neighbors(node))\n",
" firm_list = Firm_copy.index[(Firm_copy[list_neighbors]==1).all(axis=1)].to_list()\n",
" if firm_list: # there exist firm that produces all components\n",
" # lift firm with size above average in firm_list\n",
" average_size = Firm_copy.loc[firm_list, 'Revenue_Log'].mean()\n",
" firm_selected_list = Firm_copy.loc[firm_list].loc[Firm_copy.loc[firm_list, 'Revenue_Log'] >= average_size].index.to_list()\n",
" Firm_copy.loc[firm_selected_list, node] = 1\n",
" Firm_copy.loc[firm_selected_list, list_neighbors] = np.nan\n",
" else: # select top 15% firm in terms of size\n",
" firm_list = Firm_copy.index[(Firm_copy[list_neighbors]==1).any(axis=1)].to_list()\n",
" firm_df = Firm_copy.loc[firm_list].sort_values('Revenue_Log', ascending=False)\n",
" num_firm_selected = round(firm_df.shape[0] * 0.15)\n",
" firm_selected_list = firm_df.index[0: num_firm_selected].to_list()\n",
" Firm_copy.loc[firm_selected_list, node] = 1\n",
" Firm_copy.loc[firm_selected_list, list_neighbors] = np.nan\n",
"\n",
" # update attribute, number of firm\n",
" for node in nx.nodes(G):\n",
" firm_num_dict[node]= sum(Firm_copy[node]==1)\n",
" nx.set_node_attributes(G, firm_num_dict, name=\"Num_Firm\")\n",
"\n",
" # update criterion for ending the lifting process\n",
" node_check = [k for k, v in nx.get_node_attributes(G, 'Num_Firm').items() if v==0]\n",
" if '1' in node_check:\n",
" node_check.remove('1')\n",
" for node in node_check:\n",
" if G.out_degree(node) == 0:\n",
" node_check.remove(node)\n",
" print(f\"Warning: node, {node}, in tier 0 does not contain firm\")\n",
2023-02-18 18:44:26 +08:00
"\n",
"# output\n",
2023-05-15 10:42:16 +08:00
"# Firm_copy.to_csv('Firm_amended.csv', index=False, encoding='utf-8-sig')"
2023-02-16 16:11:54 +08:00
]
},
{
"cell_type": "code",
2023-02-20 22:22:41 +08:00
"execution_count": 5,
2023-02-20 17:03:36 +08:00
"metadata": {},
"outputs": [
{
"data": {
2023-02-20 22:22:41 +08:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAACyIAAAsQCAYAAABS037aAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAC4jAAAuIwF4pT92AAEAAElEQVR4nOzdd5idZZk/8O85Z3oyk0nvdBTpoBRFROwodlTEXnbX3d+ua9+qq1sVXNuqaxfFikE0ioAKCAgEBCGhJdSE9EwymZbp55zfHxMGhoRyViCUz+e65rrmvOV57vd533O4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AAAAAAAAA1E0QGAAAAAAAAAAAAAGomiAwAAAAAAAAAAAAA1EwQGQAAAAAAAAAAAAComSAyAAAAAAAAAAAAAFAzQWQAAAAAAAAAAAAAoGaCyAAAAAAAAAAAAABAzQSRAQAAAAAAAAAAAICaCSIDAAAAAAAAAAAAADUTRAYAAAAAAAAAAAAAaiaIDAAAAAAAAAAAAADUTBAZAAAAAAAAAAAAAKiZIDIAAAAAAAAAAAAAUDNBZAAAAAAAAAAAAACgZoLIAAAAAAAAAAAAAEDNBJEBAAAAAAAAAAAAgJoJIgMAAAAAAAAAAAAANRNEBgAAAAAAAAAAAABqJogMAAAAAAAAAAAAANRMEBkAAAAAAAAAAAAAqJkgMgAAAAAAAAAAAABQM0FkAAAAAAAAAAAAAKBmgsgAAAAAAAAAAAAAQM0EkQEAAAAAAAAAAACAmgkiAwAAAAAAAAAAAAA1E0QGAAAAAAAAAAAAAGomiAwAAAAAAAAAAAAA1EwQGQAAAAAAAAAAAAComSAyAAAAAAAAAAAAAFAzQWQAAAAAAAAAAAAAoGaCyAAAAAAAAAAAAABAzQSRAQAAAAA
2023-02-16 16:11:54 +08:00
"text/plain": [
2023-02-16 16:58:02 +08:00
"<Figure size 3600x3600 with 1 Axes>"
2023-02-16 16:11:54 +08:00
]
},
"metadata": {},
2023-02-16 16:58:02 +08:00
"output_type": "display_data"
2023-02-16 16:11:54 +08:00
}
],
"source": [
2023-02-18 16:46:38 +08:00
"# visualization\n",
2023-02-16 16:58:02 +08:00
"pos = nx.nx_agraph.graphviz_layout(G, prog=\"twopi\", args=\"\")\n",
2023-02-18 16:46:38 +08:00
"dict_num_firm = nx.get_node_attributes(G, 'Num_Firm')\n",
"dict_node_name = nx.get_node_attributes(G, 'Name')\n",
"node_labels = {}\n",
"for node in nx.nodes(G):\n",
2023-02-20 22:22:41 +08:00
" node_labels[node] = f\"{node} {str(dict_node_name[node])} {str(dict_num_firm[node])}\"\n",
" # node_labels[node] = f\"{str(dict_num_firm[node])}\"\n",
2023-02-16 16:58:02 +08:00
"plt.figure(figsize=(12, 12), dpi=300)\n",
"nx.draw_networkx_nodes(G, pos)\n",
"nx.draw_networkx_edges(G, pos)\n",
2023-02-18 16:46:38 +08:00
"nx.draw_networkx_labels(G, pos, labels = node_labels, font_size=4)\n",
2023-02-16 16:58:02 +08:00
"plt.show()"
2023-02-16 16:11:54 +08:00
]
},
{
"cell_type": "code",
2023-02-20 18:17:44 +08:00
"execution_count": 3,
2023-02-16 16:11:54 +08:00
"metadata": {},
"outputs": [
2023-02-18 18:44:26 +08:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 7393.0\n",
"1 171.0\n",
"2 113.0\n",
"3 24.0\n",
"4 242.0\n",
" ... \n",
"165 60.0\n",
"166 292.0\n",
"167 13371.0\n",
"168 5057.0\n",
"169 5173.0\n",
"Name: Num_Employ, Length: 129, dtype: float64\n"
]
},
2023-02-16 16:11:54 +08:00
{
"data": {
"text/plain": [
2023-02-20 20:56:27 +08:00
"<seaborn.axisgrid.FacetGrid at 0x2bd702fc820>"
2023-02-16 16:11:54 +08:00
]
},
2023-02-20 18:17:44 +08:00
"execution_count": 3,
2023-02-16 16:11:54 +08:00
"metadata": {},
"output_type": "execute_result"
2023-02-18 18:44:26 +08:00
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeoAAAHpCAYAAABN+X+UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAnqklEQVR4nO3de3TU9Z3/8dcwk0yIkMuUCOsYzG0rBUytMWsaTyldsyxbyRHt1rLh1GK9RFGhws7RHGmrZ2mS7WFTumtB40k3xC1a6xHQpVEs2KzVxnUs5jgdVhBICVl/K8owEwgMIXx/f7jMMjCBBJP5fkiej3O+p5nLd/KeD9/TpzOZi8OyLEsAAMBI4+weAAAADIxQAwBgMEINAIDBCDUAAA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srKyNHHiRLW2tiocDquhoUGFhYWqra1VU1NTsscDAMAoSQ/1e++9J8uydPXVV2v8+PGaO3eu9u3bp46ODpWVlSk9PV2SVFxcrGAwOODtRKNRRSKRuA0AgNEm6aEOBoOaMWOGnnnmGQWDQaWkpKi6ulqRSET5+fmx6zkcDjmdToVCoYS3U1dXp8zMzNiWm5ubrLsAAEDSJD3UCxcuVHt7u0pLS5Wfn6/HH39cW7Zs0cmTJ+V2u+Oum5aWpt7e3oS3U1NTo3A4HNu6urqSMT4AAEnlsnuArKwsnTx5UlOmTFEgEIi7rKenR6mpqQn3c7vdZ4UdAIDRJumPqJctW6bnnnsudvrtt9/WuHHjdNVVV6m9vT12fmdnp6LRqDweT7JHBADAGEl/RH311VfrkUc
"text/plain": [
"<Figure size 500x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2023-02-16 16:11:54 +08:00
}
],
"source": [
2023-02-18 16:46:38 +08:00
"import seaborn as sns\n",
"data = Firm_copy[Firm_copy['Num_Employ'] > 0]['Num_Employ']\n",
2023-02-18 18:44:26 +08:00
"print(data)\n",
"sns.displot(data)"
]
},
{
"cell_type": "code",
2023-02-20 18:17:44 +08:00
"execution_count": 4,
2023-02-18 18:44:26 +08:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 1.089000e+10\n",
"1 1.380000e+08\n",
"6 1.590000e+08\n",
"11 6.750000e+08\n",
"13 2.470000e+09\n",
" ... \n",
"162 5.880760e+07\n",
"167 4.110000e+10\n",
"168 4.519000e+09\n",
"169 3.470400e+10\n",
2023-02-20 18:17:44 +08:00
"170 1.000000e+08\n",
"Name: Revenue, Length: 111, dtype: float64\n"
2023-02-18 18:44:26 +08:00
]
},
{
"data": {
"text/plain": [
2023-02-20 20:56:27 +08:00
"<seaborn.axisgrid.FacetGrid at 0x2bd17758a00>"
2023-02-18 18:44:26 +08:00
]
},
2023-02-20 18:17:44 +08:00
"execution_count": 4,
2023-02-18 18:44:26 +08:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2023-02-20 18:17:44 +08:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeoAAAHpCAYAAABN+X+UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAoAklEQVR4nO3dfXSU9Z3//9c4Qyak5FYiaAgkhFa5MZbGaEzPYt1GdDeJINVdFraudBGQri2KOZWCW3F3Q7pLs7jbLhALDfGOdXtkEbsRukKR6kYZLCn5TVZASY1ZkYDjTGJkCOHz+4PjfI2QW5KZTybPxznXOZ2Z65p5X1xNns5kZi6HMcYIAABY6bJIDwAAALpGqAEAsBihBgDAYoQaAACLEWoAACxGqAEAsBihBgDAYlETamOMAoGA+Fg4ACCaRE2oW1palJiYqJaWlkiPAgDAgImaUAMAEI0INQAAFiPUAABYjFADAGAxQg0AgMUINQAAFiPUAABYjFADAGAxQg0AgMUINQAAFiPUAABYjFADAGAxQg0AgMUINQAAFiPUAABYjFADAGAxQg0AgMUINQAAFiPUAABYjFADAGAxV6QHsNlNM27RB8dPdHn7lWOv0P+8uieMEwEAhhtC3Y0Pjp9Q3sM/7/L2mrULwzgNAGA44qVvAAAsRqgBALAYoQYAwGKEGgAAixFqAAAsRqgBALAYoQYAwGKEGgAAixFqAAAsRqgBALAYoQYAwGKEGgAAixFqAAAsRqgBALAYoQYAwGKEGgAAixFqAAAsRqgBALAYoQYAwGKEGgAAixFqAAAsFvZQV1ZWyuFwXLBUVlaqrq5Oubm5Sk5OVklJiYwx4R4PAACrhD3U8+bNk8/nCy2NjY0aPXq0brrpJhUXFysnJ0cej0der1eVlZXhHg8AAKuEPdQxMTFKSkoKLVVVVZozZ47q6+vl9/tVXl6urKwslZaWatOmTeEeDwAAq7gi+eCnT5/WE088oTfeeENbtmxRXl6e4uLiJEnZ2dnyer1dbhsMBhUMBkOX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NHbsWDU3N3e6raWlRTExMRGaDACAyAt7qB966CE9//zzocv79+/XZZddpmuvvVY1NTWh6xsaGhQMBpWSkhLuEQEAsEbYX/r+6le/qpUrV2rs2LE6e/asHnjgAd17772aOXOm/H6/qqqqdM8996isrEwFBQVyOp3hHhEAAGuEPdT33HOP6uvrNWvWLMXHx+vOO+9UaWmpXC6XKioqNG/ePJWUlKijo0N79+4N93gAAFjFYSz7+q+mpiZ5PB7l5+crNTW119sFAgElJibK7/crISFhQGbJ+MpU5T388y5vr1m7UA2H/78BeSwAAC4m7M+oe5KWlqa0tLRIjwEAgBUi/q5vAADQNUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYj1AAAWIxQAwBgMUINAIDFCDUAABYbkFAbY9TR0TEQdwUAAD6nz6FeunSpgsFgp+t2796tKVOmDNhQAADgvD6HeuPGjReEeurUqXrvvfcGbCgAAHCeq7crVlVVSTr/Mvezzz6ruLi40OX//u//1vXXXz84EwIAMIz1OtS/+MUvJEkOh0PPPPOMXK7zm1522WWaNGmSnnvuucGZEACAYazXod6zZ4+k82H+1a9+pYSEhEEbCgAAnNfnv1EvXrxYbrd7MGYBAABf0Otn1J9Zv36
2023-02-18 18:44:26 +08:00
"text/plain": [
"<Figure size 500x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import seaborn as sns\n",
"data = Firm_copy[Firm_copy['Revenue'] > 0]['Revenue']\n",
"print(data)\n",
"sns.displot(data)"
2023-02-16 16:11:54 +08:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2023-05-15 10:42:16 +08:00
"version": "3.9.13"
2023-02-16 16:11:54 +08:00
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
2023-05-15 10:42:16 +08:00
"hash": "a90aeebcf29d64a654773811cc170cb25061cb2498f10ac689db374c7bf325de"
2023-02-16 16:11:54 +08:00
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}