AI 대화 도구를 사용하여 Excel 시트 데이터를 빠르게 분석하기

AI 실습 튜토리얼7개월 전에 게시 됨 AI 공유 서클
2.9K 00

물어보세요:

AI가 내 구조화된 데이터(Excel/CSV)를 더 잘 분석하도록 하려면 어떻게 해야 하나요? 내용이 너무 길어서 일부 삭제된 것 같은 느낌이 듭니다.

답변:

컨텍스트 창의 한계로 인해 AI는 매우 긴 콘텐츠를 한 번에 처리할 수 없습니다.. 또한 큰 언어 모델 자체는 수학적 연산에 능숙하지 않기 때문에 다음과 같은 문제도 있습니다.사용자가 제공한 구조화된 데이터를 기반으로 직접 계산할 수 없음. 이 시점에서 가장 좋은 방법은 코드와 함께 사용하는 것입니다.

예를 들어, ChatGPT, Claude와 같은 도구는 다음과 같은 작업을 자동으로 도와줍니다.데이터 분석을 위한 코드 생성를 사용하여 데이터를 일괄 처리할 수도 있습니다. 원하는 경우 직접 코드를 작성하여 분석을 구현할 수도 있습니다.

 

근거

  1. 전체 데이터를 제공하지 말고 데이터의 구조만 제공: AI에게 묻는 메시지에 데이터의 구조(예: 열 이름 및 데이터 유형)를 설명하거나 작은 예제 데이터만 제공하세요. 전체 데이터를 직접 붙여넣을 필요는 없으므로 입력이 너무 길어도 일부 정보가 손실되지 않습니다.
  2. 요구 사항 명확히 하기: 통계 표, 그래프 생성, 특정 메트릭 계산 등 데이터로 무엇을 하고 싶은지 또는 분석하고 싶은지 AI에 명확하게 알려주세요.
  3. AI가 코드를 생성하도록 허용: 필요에 따라 AI가 데이터를 읽고 분석하는 코드를 작성하도록 하세요. 이렇게 하면 코드가 컨텍스트 창 제한에 대한 걱정 없이 전체 데이터를 처리하고 정확한 결과를 생성할 수 있습니다.
使用AI对话工具快速分析Excel表格数据

 

일반적인 예

예를 들어, 내 X의 접속 데이터를 일별 접속 수가 포함된 csv/엑셀 파일로 내보낸 다음 이 데이터를 ChatGPT에 제출하여 "올해 내 트윗 데이터 분석, 어느 달에 가장 많은 접속이 있었나요?"(Claude는 괜찮습니다)라고 질문한다고 가정해 봅시다. 어느 주에 가장 많은 방문이 있었나요? 가장 많은 방문이 있었던 날은 언제인가요?"라고 물어봅니다.

使用AI对话工具快速分析Excel表格数据

 

ChatGPT 가장 먼저 할 일은 내 데이터를 샘플링하여 데이터 구조가 어떻게 생겼는지 파악하는 것입니다.

使用AI对话工具快速分析Excel表格数据

 

그런 다음 요구 사항에 따라 코드를 생성하고 마지막으로 코드를 실행하여 결과를 얻습니다.

使用AI对话工具快速分析Excel表格数据

 

Claude 유일한 차이점은 ChatGPT는 Python을 사용하고 Claude는 JavaScript를 사용한다는 점입니다.

使用AI对话工具快速分析Excel表格数据

 

클로드가 결과를 반환합니다:

我来帮您分析这些数据。我会使用分析工具来处理CSV文件,查看不同时间维度的访问量(Profile visits)数据。

// 读取并解析CSV文件
const fileContent = await window.fs.readFile('account_overview_analytics 2.csv', { encoding: 'utf8' });
import Papa from 'papaparse';

const parsedData = Papa.parse(fileContent, {
  header: true,
  dynamicTyping: true,
  skipEmptyLines: true
});

const data = parsedData.data;

// 按月份分组
const monthlyVisits = {};
data.forEach(row => {
  const date = new Date(row.Date);
  const monthKey = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
  if (!monthlyVisits[monthKey]) {
    monthlyVisits[monthKey] = 0;
  }
  monthlyVisits[monthKey] += row['Profile visits'] || 0;
});

// 找出访问量最大的月份
const maxMonthVisits = Object.entries(monthlyVisits)
  .sort((a, b) => b[1] - a[1])[0];
console.log('月度访问量最高:', maxMonthVisits);

// 按周分组
const weeklyVisits = {};
data.forEach(row => {
  const date = new Date(row.Date);
  const weekNumber = getWeekNumber(date);
  const weekKey = `${date.getFullYear()}-W${String(weekNumber).padStart(2, '0')}`;
  if (!weeklyVisits[weekKey]) {
    weeklyVisits[weekKey] = 0;
  }
  weeklyVisits[weekKey] += row['Profile visits'] || 0;
});

// 找出访问量最大的周
const maxWeekVisits = Object.entries(weeklyVisits)
  .sort((a, b) => b[1] - a[1])[0];
console.log('周访问量最高:', maxWeekVisits);

// 找出访问量最大的天
const dailyVisits = data.map(row => ({
  date: row.Date,
  visits: row['Profile visits'] || 0
}));
const maxDayVisits = dailyVisits.sort((a, b) => b.visits - a.visits)[0];
console.log('日访问量最高:', maxDayVisits);

// 辅助函数:获取日期所在的周数
function getWeekNumber(date) {
  const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
  const dayNum = d.getUTCDay() || 7;
  d.setUTCDate(d.getUTCDate() + 4 - dayNum);
  const yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1));
  return Math.ceil((((d - yearStart) / 86400000) + 1)/7);
}

根据分析结果:

1. 访问量最高的月份是 2024年2月,总访问量达到了 25,317 次
2. 访问量最高的周是 2024年第7周(2月中旬),访问量为 9,537 次
3. 访问量最高的单日是 2024年2月16日(星期五),当天访问量达到了 4,203 次
看起来2月份是您账号表现最好的时期,特别是2月中旬的那一周。您是否记得在2月16日发布了什么特别的内容,导致访问量激增?这可能对您未来的内容策略有所启发。
如果您想了解更多细节,比如具体的内容类型分析或者其他指标(如互动率、关注率等),我也可以为您进一步分析。

 

ChatGPT.

import pandas as pd

# Load the CSV file to analyze the data
file_path = '/mnt/data/account_overview_analytics (2).csv'
data = pd.read_csv(file_path)

# Display the first few rows to understand the structure of the data
data.head()

Result:
Result
                Date  Impressions  Likes  Engagements  Bookmarks  Shares  
0  Fri, Dec 27, 2024        17955     65          405         29       1   
1  Thu, Dec 26, 2024      1126219   2870        21818       1386      65   
2  Wed, Dec 25, 2024      1657311   4312        19589       1544      78   
3  Tue, Dec 24, 2024       401326   1424        12266        749      41   
4  Mon, Dec 23, 2024       467837   1528        16703        782      43   

New follows  Unfollows  Replies  Reposts  Profile visits  Create Post  
0            4          0       10       10              35            0   
1          206         39      198      427            1099            1   
2          361         23      179      667            1700            3   
3          141         15      153      272             517            5   
4           96         27      217      260             559            2   

Video views  Media views  
0          242          346  
1        22707        88041  
2        12096        23161  
3        17368        42005  
4        34821        77995  

The dataset includes columns such as Date, Impressions, Likes, and others. To answer your questions regarding:

1. Month with the maximum impressions: I'll group the data by month and calculate total impressions.
2. Week with the maximum impressions: I'll group the data by week and calculate total impressions.
3. Day with the maximum impressions: I'll find the single date with the highest impressions.
Let me proceed with the calculations.

# Convert the 'Date' column to a datetime format for easier grouping
data['Date'] = pd.to_datetime(data['Date'], format='%a, %b %d, %Y')

# Add helper columns for month and week
data['Month'] = data['Date'].dt.to_period('M')
data['Week'] = data['Date'].dt.isocalendar().week

# Group by month and sum the impressions
monthly_impressions = data.groupby('Month')['Impressions'].sum()

# Group by week and sum the impressions
weekly_impressions = data.groupby('Week')['Impressions'].sum()

# Find the day with the maximum impressions
max_day = data.loc[data['Impressions'].idxmax()]

# Extract the results
max_month = monthly_impressions.idxmax()
max_month_value = monthly_impressions.max()

max_week = weekly_impressions.idxmax()
max_week_value = weekly_impressions.max()

max_day_date = max_day['Date']
max_day_value = max_day['Impressions']

(max_month, max_month_value, max_week, max_week_value, max_day_date, max_day_value)

Result

(Period('2024-02', 'M'),
 22484999,
 7,
 7480737,
 Timestamp('2024-02-16 00:00:00'),
 2753640)

Here is the analysis of your tweet impressions:

1. Month with the maximum impressions: February 2024, with a total of 22,484,999 impressions.
2. Week with the maximum impressions: Week 7 (mid-February 2024), with a total of 7,480,737 impressions.
3. Day with the maximum impressions: February 16, 2024, with 2,753,640 impressions.
Let me know if you'd like a more detailed visualization or further breakdown!

 

위의 AI 도구에 액세스할 수 없는 경우 해당 국가에서 유사한 제품을 사용해 보세요:지적으로 자극적인 연설상 당 왕조(기원전 16세기)와의 상담 모두 엑셀 파일의 데이터 분석에 특화된 AI 대화 도구가 있습니다.

© 저작권 정책

관련 문서

댓글 없음

댓글에 참여하려면 로그인해야 합니다!
지금 로그인
없음
댓글 없음...