Tech15 pandas - Complete Usage of loc and iloc Data Import import pandas as pd from sklearn.datasets import load_boston # Load the Boston Housing Prices dataset boston = load_boston() boston_df = pd.DataFrame(boston.data, columns=boston.feature_names) boston_df['PRICE'] = boston.target A complete usage of loc The .loc[] function in Pandas is a powerful tool for data indexing and selection. With the Boston Housing Prices dataset, you can use .. 2023. 7. 30. pandas - Subsetting Columns and Rows Data Import import pandas as pd from sklearn.datasets import load_boston # Load the Boston Housing Prices dataset boston = load_boston() boston_df = pd.DataFrame(boston.data, columns=boston.feature_names) boston_df['PRICE'] = boston.target Subsetting a single column using the column name as an attribute To subset a single column from the Boston Housing Prices dataset, you can use the DataFrame's.. 2023. 7. 30. pandas - Sorting DataFrame Data Import import pandas as pd from sklearn.datasets import load_boston # Load the Boston Housing Prices dataset boston = load_boston() boston_df = pd.DataFrame(boston.data, columns=boston.feature_names) boston_df['PRICE'] = boston.target Sorting DataFrame Sorting can be done using .sort_values(). We need to sepcify the columns in a list and also specify if we want to sort in ascending or desce.. 2023. 7. 30. pandas - Basic DataFrame Inspection Data Import import pandas as pd from sklearn.datasets import load_boston # Load the Boston Housing Prices dataset boston = load_boston() boston_df = pd.DataFrame(boston.data, columns=boston.feature_names) boston_df['PRICE'] = boston.target Inspect DataFrame First Few Rows of the DataFrame: This will show the first few rows of the DataFrame, which will include both the input features (columns fro.. 2023. 7. 30. pandas - Data Import Data Import with pandas To import the Boston Housing Prices dataset and build a DataFrame with column names for the target and features, you can use the load_boston() function from sklearn.datasets and then create the DataFrame using pandas. Here's the code to do that: import pandas as pd import numpy as np from sklearn.datasets import load_boston boston = load_boston() X_boston = boston.data y_.. 2023. 7. 30. 기계 학습을 위한 무료 데이터셋 Top 3 머신러닝 공부를 위한 무료 데이터셋은 무엇이 있을까? 드디어 머신러닝 공부를 시작하기로 마음을 먹었다면 실습을 위한 데이터셋이 필요하다. 물론 본인의 필드에서 머신러닝을 위한 데이터셋을 구해서 공부를 하면 금상천화겠지만 그런 경우에 리퍼런스가 없다는 문제가 발생한다. 그래서 인터넷에서 쉽게 구할 수 있고, 무료이며, 책이나 블로그들에서 많이 리퍼런스하고 있는 데이터셋을 찾으면 비록 본인이 실제로 하는 업무와는 동떨어진 학습을 하게 되겠지만 한편으로는 빠르고 쉽게 공부를 할 수 있는 장점이 있다. 특히, 이미 많은 온라인 책이나 튜토리얼 사이트 등에서 사용되고 있기 때문에 많은 코드들을 참조하여 본인만의 코드를 쉽게 짜집기하여 재사용할 수 있다. 그럼 기계 학습을 위한 무료 데이터셋 Top 5를 알아보자... 2023. 7. 30. 이전 1 2 다음