[Pandas][DaraFrame]S2_01_DataFrame
In [1]: import pandas as pd In [3]: # data client_df = pd.DataFrame({'Client ID':[111, 112, 113, 114], 'Client Name':['Michael','Donald','John','Matthew'], 'Net Worth[$]': [3000, 40000, 100000, 15000], 'Years': [5, 9, 10, 12]}) client_df Out[3]: Client ID Client Name Net Worth[$] Years 0 111 Michael 3000 5 1 112 Donald 40000 9 2 113 John 100000 10 3 114 Matthew 15000 12 In [4]: # the data type t..
2023. 1. 17.
[Pandas][Series] S1_02_custom_index: 사용자 지정 인덱스
In [1]: import pandas as pd In [3]: # 5 stocks list1 = ['NVDA','MSFT','META','AMZN','GOOGL']; list1 Out[3]: ['NVDA', 'MSFT', 'META', 'AMZN', 'GOOGL'] In [4]: # index labels1 = ['#1','#2','#3','#4','#5']; labels1 Out[4]: ['#1', '#2', '#3', '#4', '#5'] In [6]: s1 = pd.Series(data = list1, index = labels1); s1 Out[6]: #1 NVDA #2 MSFT #3 META #4 AMZN #5 GOOGL dtype: object In [8]: # datatype type(s1..
2023. 1. 17.