lunarflu HF staff commited on
Commit
988f666
1 Parent(s): 400a5ad

df = get_as_dataframe(worksheet, dtype={‘a’: np.int64}

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -374,17 +374,30 @@ async def read_csv(ctx):
374
  @bot.command()
375
  async def dataframe_test(ctx):
376
  if ctx.author.id == 811235357663297546:
 
 
 
 
 
 
 
 
377
  worksheet = gspread_bot.open("levelbot").sheet1
378
  test_worksheet = gspread_bot.open("test").sheet1
379
 
380
- df = get_as_dataframe(worksheet)
381
- print(df)
382
- set_with_dataframe(test_worksheet, df, format='N0')
383
 
384
 
385
 
386
 
387
 
 
 
 
 
 
 
388
 
389
  # embeds with user pfps?
390
  # name, pfp, time in server....
 
374
  @bot.command()
375
  async def dataframe_test(ctx):
376
  if ctx.author.id == 811235357663297546:
377
+
378
+ """
379
+ URL = "https://docs.google.com/spreadsheets/d/1YJEwP7kZChI3Z2GKv4zFEfwwyQrO3zwXclv0QMrkOqA/edit#gid=0"
380
+ csv_url = URL.replace('/edit#gid=', '/export?format=csv&gid=')
381
+ data = pd.read_csv(csv_url)
382
+ print(data)
383
+ """
384
+
385
  worksheet = gspread_bot.open("levelbot").sheet1
386
  test_worksheet = gspread_bot.open("test").sheet1
387
 
388
+ df = get_as_dataframe(worksheet, dtype={‘a’: np.int64})
389
+ set_with_dataframe(test_worksheet, df)
 
390
 
391
 
392
 
393
 
394
 
395
+ def get_data():
396
+
397
+ first_3_columns = data.iloc[:, 1:4] # Skip the first column and select the next three columns
398
+ first_3_columns.to_csv('first_3_columns.csv', index=False)
399
+ return first_3_columns
400
+
401
 
402
  # embeds with user pfps?
403
  # name, pfp, time in server....