repl.it
@NityeshAgarwal/

ted-talk-hello-world

Python

Simple aim: just retreive and print one of the talks in the data base

fork
loading
Files
  • main.py
  • license.txt
  • README.md
  • text_data.txt
  • usermodule.py
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import pandas as pd
import requests

download = False
if download:
    print('Downloading...')
    file_link = 'https://raw.githubusercontent.com/kinnaird-laudun/data/master/Release_v0/TEDonly_final.csv'

    
    r = requests.get(file_link)
    print(r)
    print(r.headers)
    print('----1----')
    text_data = r.text

    with open('text_data.txt', 'w') as file:
        file.write(text_data)
    
  
  


df = pd.read_csv('text_data.txt', sep=",")
print("-----printing data frame-----")
print(df) 
print()

print("-----The data frame has the following columns-----")
print(df.columns)
print()

print("-----Here is a list of the speakers:-----")
print(df['speaker_1'])
print()

print("-----row 0:-----")
print(df.iloc[0])
print()

print("-----speaker of first talk-----")
print(df.iloc[0]["speaker_1"])
print()

print("-----Text of speech-----")
print(df.iloc[0]['text'])
print()
?