[matplotlib]S5_06_pie_chart
In [1]: import matplotlib.pyplot as plt import pandas as pd import datetime In [2]: # data crypto_dict = {'allocation': [20,55,5,17,3]} explode = (0,0,0,0.2,0) In [3]: crypto_df = pd.DataFrame(data= crypto_dict, index=['BTC','ETH','LTC','XRP','ADA']) crypto_df Out[3]: allocation BTC 20 ETH 55 LTC 5 XRP 17 ADA 3 In [4]: # a pie chart crypto_df.plot.pie(y = 'allocation',explode = explode, figsize ..
2023. 1. 21.
[Pandas][DataFrame][concat]S3_02_concatenation_with_multi_indexing
In [1]: import pandas as pd In [2]: raw_data = {'Bank Client ID': ['1', '2', '3', '4', '5'], 'First Name': ['Robert', 'Benedict', 'Mark', 'Tom', 'Ryan'], 'Last Name': ['Downey', 'Cumberbatch', 'Ruffalo', 'Holland', 'Reynolds']} bank1_df = pd.DataFrame(raw_data, columns = ['Bank Client ID', 'First Name', 'Last Name']) In [3]: raw_data = {'Bank Client ID': ['6', '7', '8', '9', '10'], 'First Name':..
2023. 1. 21.
[Pandas][DataFrame][concat]S3_01_concatenation
In [1]: import pandas as pd https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html In [2]: raw_data = {'Bank Client ID': ['1', '2', '3', '4', '5'], 'First Name': ['Robert', 'Benedict', 'Mark', 'Tom', 'Ryan'], 'Last Name': ['Downey', 'Cumberbatch', 'Ruffalo', 'Holland', 'Reynolds']} bank1_df = pd.DataFrame(raw_data, columns = ['Bank Client ID', 'First Name', 'Last Name']) bank1_df O..
2023. 1. 21.