Тёмный

1.2 Tabular Data - Working With Data & APIs in JavaScript 

The Coding Train
Подписаться 1,7 млн
Просмотров 213 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 167   
@TheCodingTrain
@TheCodingTrain 5 лет назад
For this to work, make sure you are running a local server! I cover how to do this with node.js here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FjWbUK2HdCo.html
@digigoliath
@digigoliath 5 лет назад
No wonder. LOL
@atyourservice5728
@atyourservice5728 4 года назад
csv vs sql table?
@choudharyusama7474
@choudharyusama7474 4 года назад
Hello I am facing a problem I try to load csv file and when i update the csv file and refresh my browser the data can't updated unless I refresh the browser by ctrl f5
@craigtcooper777
@craigtcooper777 4 года назад
@@choudharyusama7474 He's using a cool extension in vscode called Live Server marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer Which is making it so that it's a live reload. Hope that helps! :)
@anandarya4664
@anandarya4664 4 года назад
@@choudharyusama7474 ya that may due its cache
@prernasharma3439
@prernasharma3439 5 лет назад
You know what? I'll come to the video and content later, Firstly I want to say you are such a nice person. It's like you are enjoying work and always happy and in a jolly mood. That makes learning fun. Thank you for making JavaScript interesting. Also, the content is so good and the videos are so interesting. Thankyou.
@TheCodingTrain
@TheCodingTrain 5 лет назад
Thank you for the nice feedback!
@sajintamang1037
@sajintamang1037 3 года назад
This guy is absolute nuts. Best content for API ever on internet. May god bless you and family man . your videos has really helped me a lot
@kenfeier5542
@kenfeier5542 5 лет назад
I love that you break down everything so simply and show implementation using code. You make learning this stuff a lot easier than it was for me in college. Let alone you've taught me more!
@blusanders
@blusanders 3 года назад
6 weeks into sw bootcamp. Really enjoy the videos. Easy to understand and fun to watch.
@BradleyDunlap
@BradleyDunlap 5 лет назад
Great production in this video Daniel! Congrats to your editor. Also, great presentation by you per usual.
@ritwikbaksi8407
@ritwikbaksi8407 4 года назад
Honestly was confused by the array portion and didn't expect you to go back and explain it again. Thanks so much.
@sorrychou
@sorrychou 5 лет назад
簡單明確的步驟處理csv資料,對初學者非常好👍
@Djzaamir
@Djzaamir 5 лет назад
I really love this new editing style, where the references are popping out in the back as you talk :) Good Job Coding Train
@alanalencar
@alanalencar 4 года назад
Hello, I couldn't leave a message of congratulations for you. Simply the best. Direct, clear, didactic and simply outstanding. Watching everything from here in Brazil.
@mehmeteminyldz5750
@mehmeteminyldz5750 4 года назад
Dan, thank you a lot for this great video. I love the way you teach. Instead of publishing videos where everything goes perfect, you make mistakes and correct them. Actually, that is the way how people learn things.
@shubhrashukla7879
@shubhrashukla7879 5 лет назад
is that the dan that i knew who always made mistakes? I don't know when you got so professional but it looks really cool and the production and editing were at another level. sooooo kudos to you!
@TheCodingTrain
@TheCodingTrain 5 лет назад
Yeah, this is an experiment. . but I'm still going to do my raw live streams!!!
@filcondrat
@filcondrat 5 лет назад
what is that all about
@pulok9909
@pulok9909 3 года назад
My teacher who I really love. Thanks for your great teaching with always smile on the face.
@andrewlawton7415
@andrewlawton7415 4 года назад
Its about time somebody explains this and it makes REAL sense! kudos!
@programming-dude
@programming-dude 2 года назад
really love your teaching style make me smile at your expression
@shashankthapa659
@shashankthapa659 2 года назад
One of the best video so far on API's enjoying the course. Thanks Daniel!😇
@SumitGupta-ys7lb
@SumitGupta-ys7lb 10 месяцев назад
Quick and simple explanation! Thanks a lot!!
@user-yq2em5ho9q
@user-yq2em5ho9q 4 года назад
Seriously learning something never felt this easy 🤩
@RupertBruce
@RupertBruce 2 года назад
Thank you for the RainbowCSV link - it's got a lot more than just a rainbow - a veritable pot of gold!
@richardramirez5746
@richardramirez5746 Год назад
No way to thank you for these contributions!
@grainfrizz
@grainfrizz 5 лет назад
Dan, don't be afraid to say that 🐼 is a level 11 cuteness. :)
@nelnav1222
@nelnav1222 4 года назад
I love this channel, I dont know English but Im understanding
@kdog.unleashed
@kdog.unleashed 3 года назад
Just want to thank you for all your great work. You helped me so many times! Thank you! Greetings from berlin!
@schitlipz
@schitlipz 8 месяцев назад
Thanks. I needed to know a lot of the details in this video. [Never mind, even running a local server isn't satisfying it no more]
@cesaremannino2774
@cesaremannino2774 3 года назад
I`m coming from Django, Kudos to the teacher to make node.js so understandable! so far is easier than Django...
@GilbertBigelow
@GilbertBigelow 5 лет назад
For handling/ removing the header Instead of using slice just start the 'for loop' at 1 and you will not add extra processes to the code. I am just an amateur and not trying to critique your work just making an observation while learning from you many other things I have yet to put together. Mr. Shiffman, Thanks for the great learning tools you provide.
@jamesa.
@jamesa. 4 года назад
Oh Yes I totally get your point sir! good one, also we might notice that he later went on to user forEachLoop which start from the first element. :) , but the way you described it is also a nice alternative I must say,
@poornaathreya
@poornaathreya 3 года назад
My fetch isn't working. Every time it says the following error: Try.html:10 Fetch API cannot load file. URL scheme must be "http" or "https" for CORS request. Any help would be welcome🤧👍🏼
@Hamid-lo4wu
@Hamid-lo4wu 3 года назад
I am getting the same error ... If you found the solution , please let me know, thanks
@melissabarrera7176
@melissabarrera7176 3 года назад
maybe this is a little too late to be answering, but to who it may concern... it needs to be hosted on a live server somewhere for the Fetch API to work correctly. Instead of opening on default browser, you can install 'Live Server' (a VSCode extension) and open it with that! :)
@Hamid-lo4wu
@Hamid-lo4wu 3 года назад
@@melissabarrera7176 yes It's the right solution... I fixed it later & I finished my work .... Thank u for your answer
@VincentFS
@VincentFS Год назад
@@melissabarrera7176 THANK YOU
@rotrose7531
@rotrose7531 4 года назад
Thank you for unfailingly providing these great stuff. I always learn a lot from you.
@anishnair7348
@anishnair7348 3 года назад
Thank you so much sir. Your video on api and fetch() helped me to complete my project. You have explained it so nicely and in simple way for beginners. 😍
@juansantiagocuadra3672
@juansantiagocuadra3672 5 лет назад
Thank you for all the great content.
@DioArsya
@DioArsya 3 года назад
Wow, i used to work with data like this in Python when i'm working with my ML and DL projects back then. Now i want to learn javascript and vuejs for my website projects, and guess what. I'm learning data manipulation again here in another concepts of language. Hahaha thank you, sir! :)
@heatherjackson920
@heatherjackson920 Год назад
Wow, your videos are high quality. Thank you!
@JasonLayton
@JasonLayton 4 года назад
Really enjoying the course and your energy. Thank you.
@CarlosLopez-tm7bp
@CarlosLopez-tm7bp 2 года назад
You are the one! Love your energy!
@frankberry184
@frankberry184 2 года назад
I think you should do videos on react too cause i love the way you teach. you are good. Am actually learning react though
@albertofantozzi7804
@albertofantozzi7804 4 года назад
That ending clip tho! Amazing !
@arielspalter7425
@arielspalter7425 4 года назад
Just came across your videos. Awesome stuff! Subscribed.
@kindlyman100
@kindlyman100 3 года назад
the writing of the code is readable, a very elite thing
@madhavjha5289
@madhavjha5289 5 лет назад
Amazing tutorial 👍
@ashutoshagrawal3076
@ashutoshagrawal3076 5 лет назад
hi Madhav I am Ashutosh Agrawal.
@nicotomomate
@nicotomomate 4 года назад
I randomly get this video playing and said "this guy is a great teacher".. Then i realized you have 1 millions suscribers 😂
@abazur7742
@abazur7742 5 лет назад
If you are going to make more high quality tutorials like this one, you will it 1mil subs soon
@laalaajonsen
@laalaajonsen 4 года назад
aaaand it's done!
@City__Walker
@City__Walker 2 года назад
Ohh i need this for my project (made charts as in power bi upload data and create chart use uploaded data)😍😍
@walkastray007
@walkastray007 5 лет назад
Everyone gets a nickle every time Dan says "beyond the scope of this video" every video
@heksqer1022
@heksqer1022 5 лет назад
Amazing video Dan ! the editing was cool
@wfalcao69
@wfalcao69 3 года назад
WOW!!!!! You are my best friend.
@ridvankadayifci6100
@ridvankadayifci6100 5 лет назад
Very good job 👍👍
@matther2012
@matther2012 5 лет назад
Seems like this example could have made use of the map function, instead of the forEach and all of the const variables. Great video as always!
@TheCodingTrain
@TheCodingTrain 5 лет назад
Ah, good point!
@oumao
@oumao 3 года назад
You can as well refactor the columns data by performing an array destructuring such that const [year, temp] = columns;
@sciencefordreamers2115
@sciencefordreamers2115 3 года назад
Absolutely awesome! However, I lost an hour before I realized I had to Disable Same Origin Policy to get rid of the browser error I was getting. The sequence to do this : about:config -> security.fileuri.strict_origin_policy -> false
@omarsh82
@omarsh82 2 года назад
Yes me too...great video.
@frankberry184
@frankberry184 2 года назад
I think you will help me understand react better
@DeathToCockroaches
@DeathToCockroaches 4 года назад
Wish there was this quality of content for asp.net/c# microsoft related stuff
@prithwirajdutta3827
@prithwirajdutta3827 5 лет назад
Amazing ! Thanks Daniel.
@matissjudins6272
@matissjudins6272 2 года назад
thank you so much
@bedrockcoder5169
@bedrockcoder5169 4 года назад
Is there a way to get the data straight from the website?
@oliviamooney8995
@oliviamooney8995 5 лет назад
I'd love to see your settings to vsc.
@chubbyBunny94
@chubbyBunny94 2 года назад
I paused the video at 3:50. It took me 2hours and 45 mins to do it myself. I created functions that create a table and inject the headings and data. So noob :'D but progress!
@TheCodingTrain
@TheCodingTrain 2 года назад
Great work!!
@jakeryansison1764
@jakeryansison1764 3 года назад
THANK YOU
@alexanderbell7736
@alexanderbell7736 4 года назад
Hey Dan, I don't see the solution for getting multiple files in the git repo. I'm also not sure if you want us to fetch a directory of images and then display those, or just create two fetch commands for unique files. One is simple, the other I can't solve. Thanks for another enjoyable, informative video :)
@michalbotor
@michalbotor 5 лет назад
question: where do javascript variables live anyways? are they maybe allocated in a ram reserved for the bowser's tab, or separately? is there a limit to how much % of ram one tab can occupy, or can it take the whole ram or maybe be even stored on a hard drive if it needs be? is the transfer of the data from/to ram to/from browser slower than the transfer of the data from/to ram to/from desktop app would be, like say python ide? also: is this csv file fetched only once, or is it being fetched repeatedly?
@alekseiterin988
@alekseiterin988 5 лет назад
Just google it
@saifahmad5777
@saifahmad5777 4 года назад
you are awsome
@Altamashattari786
@Altamashattari786 3 года назад
What if your CSV strings contain newline character or comma character in the data then splitting based on those characters will lead to unexpected results
@jefersonfs
@jefersonfs 4 года назад
Hi teacher! Cheers from Brazil! Look, can you tell me how can I export the data into a json file?
@avneetsingh2010
@avneetsingh2010 3 года назад
very well :)
@nayankumar1421
@nayankumar1421 5 лет назад
I couldn't able to use fetch(). Getting error in console on CORS. I tried to remove CORS its not worked for me. How to read local file using fetch. Could you please any one help me? Thanks in advance
@TheCodingTrain
@TheCodingTrain 5 лет назад
Are you running a local server? I definitely need to make this more clear! More here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FjWbUK2HdCo.html
@nayankumar1421
@nayankumar1421 5 лет назад
Oops I miss this video. Thanks for your reply
@clandestine1699
@clandestine1699 5 лет назад
I was following along, but I was wondering why my temp data was different than yours? Example, 1880 , -.19 and 1881, -.10: Your set shows 1880, -.18 and 1881, -.09 ???
@TheCodingTrain
@TheCodingTrain 5 лет назад
Weird, maybe I'm referencing the incorrect file or I downloaded the wrong file by accident while making the video?
@PaulMcCannWebBuilder
@PaulMcCannWebBuilder 5 лет назад
It looks like they've updated the data since the video.
@sarfrazrajpoot2055
@sarfrazrajpoot2055 2 года назад
Geo sir
@nileshgurung9437
@nileshgurung9437 5 лет назад
Awesome👍
@techzee9000
@techzee9000 4 года назад
Hello Code train, thanks for all your presentations they are interesting and educative. I got an error when trying to load the csv on console.log ( Fetch API cannot load file:/// URL scheme must be "http" or "https" for CORS request. getData @ index.html:18
@waverwind1
@waverwind1 4 года назад
I have the same problem
@techzee9000
@techzee9000 4 года назад
@@waverwind1 Have u solved it , what did u do
@waverwind1
@waverwind1 4 года назад
@@techzee9000 yes, I use Visual Studio Code and installed the extension Live Server (see here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-y4qqQeUDCBQ.html) Right click on the repository and open with Live Server. Good Luck!
@techzee9000
@techzee9000 4 года назад
@@waverwind1 thanksss
@blackmilk86
@blackmilk86 3 года назад
@@waverwind1 thanks!!!
@AZAMKHAN-vl4lq
@AZAMKHAN-vl4lq 4 года назад
hello sir ,, can we fetch data direct from fetch("htttps://xyz") withoout saving in our cvs file in code editor,,if yes how can i do this? please reply
@martinb3523
@martinb3523 3 года назад
i think not, you probably need a proxy. Like for the image in the last video i tried to get it online and CORS yelled at me XD so i researched it and it happened to be that you need another server to serve you the info that youre requesting from the other server. Look up "CORS anywhere" and try it with that.
@munandisichali605
@munandisichali605 5 лет назад
Thanks for the best way to learn codding, can you do a livechart with chart.js, or protly.js....
@TheCodingTrain
@TheCodingTrain 5 лет назад
Next video uses chart.js!
@Dasrecord
@Dasrecord 2 года назад
how did the get data function execute before it was defined?
@GrumpyOldMan9
@GrumpyOldMan9 3 года назад
You kicked the can down the road; waddaya do when you wanna use that array OUTSIDE of that async scope ??
@DA-rf7zj
@DA-rf7zj 8 месяцев назад
Just so you know, VS Code doesn't really handle local files like the test.cvs file you use.
@sup9140
@sup9140 4 года назад
How to take the csv directly from website without from local file?
@augischadiegils.5109
@augischadiegils.5109 2 года назад
❤️❤️❤️❤️❤️
@atulonweb1
@atulonweb1 3 года назад
I want user of my website to be able to upload data and make have option to make different type of charts. I am researching on that, any idea how to achieve that.
@s0n1c88
@s0n1c88 5 лет назад
Great tut Shiffman, you shiff us to the next level >.< (i know its a bad joke :D)
@anishagrawal7068
@anishagrawal7068 5 лет назад
But what about CORS!!
@jnsjknn
@jnsjknn 5 лет назад
Exactly.
@AlexMerlin1985
@AlexMerlin1985 5 лет назад
That's beyond the scope of this video :)
@anishagrawal7068
@anishagrawal7068 5 лет назад
@@AlexMerlin1985 Is there a viable soln. to client sided CORS?
@rubyna5472
@rubyna5472 4 года назад
hi coding train...i have a hard time to fetch the csv file...the console always show fetch api cannot load eventhough i save it in the same file directory...can you tell me how to fix this...
@iNuchalHead
@iNuchalHead 5 лет назад
Would "const table = await response.text().split(' ').slice(1);" be a bad idea? Thinking that it might be nice to do splitting and slicing asynchronously if the file is huge.
@TheCodingTrain
@TheCodingTrain 5 лет назад
Interesting! I think that would work, sometimes I break things into multiple lines just for clarity. But chaining can make a lot of sense too!
@junky3445
@junky3445 2 года назад
I'm getting a cannot find variable error for Chart in the myChart function that displays the table idk why, its declared as a new variable so idk why and tried to call it as a global variable but still doesn't work. Any recommendations?
@chamnil8666
@chamnil8666 4 года назад
data.split(/ /),didnt work,since data is not a string,when i check typeof data it gives me an object.how do i turn object to string?
@gabrielnobredesouza3789
@gabrielnobredesouza3789 5 лет назад
not sure if watching Bob Ross painting or a coding class
@shyamsoni5389
@shyamsoni5389 3 года назад
Hi, I am using this.props.history.push({ pathname:`some path`, state:{ object :object} }) ; on handleSubmit click And reading the data into routed component like this.props.location.state.objectName.field This is working fine when I am using BrowserRouter even when i refresh the page i get the values on page BUT when I am using Hashrouter and I refresh the page I get error saying Can not read properties of undefined Please help
@maximillienkwizera4167
@maximillienkwizera4167 3 года назад
am using Atom editor and its live server can not switch to different file. it only loads one file. ANY HELP??? @The codin train
@OonHan
@OonHan 5 лет назад
Yes!!!
@OLSCGMS
@OLSCGMS 2 года назад
I am getting cors error when i tried to fetch the file
@OLSCGMS
@OLSCGMS 2 года назад
@The Coding Train
@AbhishekSharma-uy1zv
@AbhishekSharma-uy1zv 3 года назад
Fetch Api cannot load the url Url scheme file is not supported error
5 лет назад
Do i need some import function or something? This fetch method throws me an error "index.html:15 Fetch API cannot load file:////////test.csv. URL scheme must be "http" or "https" for CORS request." Pls help
@TheCodingTrain
@TheCodingTrain 5 лет назад
For this to work, you need to be running a local server! I should have made this more clear, see: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FjWbUK2HdCo.html
@amirsohel9260
@amirsohel9260 3 года назад
it's giving me error when I am giving CSV path in Fetch
@smile4992
@smile4992 11 месяцев назад
const response = await fetch(csv_url); const csv = await response.text(); const json = Papa.parse(csv).data;
@hakata8889
@hakata8889 3 года назад
just thx
@gouravchouhan1790
@gouravchouhan1790 3 года назад
Why didn't u used console.table(), I was desperately waiting for that since I was following along, next time......
@BobbyBundlez
@BobbyBundlez 4 года назад
how do i just download this csv i cant seem to do that of github to practice with it.... or any csv for that matter... i cant fetch locally like he did in this tutorial. stupid question but still ! fetch('test.csv') wont work even if i have the file locally
@martinb3523
@martinb3523 3 года назад
i think you need to start a live server in your text editor, then it will probably work.
@josephyou4461
@josephyou4461 4 года назад
I download .csv file and saved it on the same directory with .html folder. but it is not work. Where is the right place to save csv file?
@maxdegreat566
@maxdegreat566 3 года назад
did u ever figure it out?
@martinb3523
@martinb3523 3 года назад
​@@maxdegreat566 you save it there but you need to open a local/live server from your text editor and it should work. Or get the link to the info and use a proxy like "CORS anywhere" to get the data.
@teebu
@teebu 4 года назад
A few people ask how to get it from the remote url. While not pretty, using a middle service that adds the needed cors is one way. fetch('cors-anywhere.herokuapp.com/data.giss.nasa.gov/gistemp/tabledata_v4/ZonAnn.Ts+dSST.csv');
@DigitalMonsters
@DigitalMonsters 5 лет назад
I parsed it like this but its really hard to read i think. async function getData() { const csv = await fetch('./global_temps.csv') const text = await csv.text() let raw_table = text.split(' ') let raw_headers = raw_table.splice(0, 1)[0] let parsed_data = raw_table.map(row => { let columns = row.split(',') let headers = raw_headers.split(',') return headers .map((header, index) => { return { [header]: columns[index] } }) .reduce((acc, item) => { const key = Object.keys(item)[0] const value = item[key] acc[key] = value; return acc }, {}) }); parsed_data.splice(-1, 1); }
@anuraghazra4772
@anuraghazra4772 5 лет назад
Nice!
@iminni3459
@iminni3459 5 лет назад
Could you put a link to rainbow CSV in the description please?
@TheCodingTrain
@TheCodingTrain 5 лет назад
added!
@iminni3459
@iminni3459 5 лет назад
Thank you!
Далее
I Parsed 1 Billion Rows Of Text (It Sucked)
39:23
Просмотров 135 тыс.
Women’s Celebrations + Men’s 😮‍💨
00:20
TRENDNI BOMBASI💣🔥 LADA
00:28
Просмотров 913 тыс.
1.4: JSON - Working with Data and APIs in JavaScript
16:22
The Only Database Abstraction You Need | Prime Reacts
21:42
You don't need a frontend framework
15:45
Просмотров 127 тыс.
The Weird History of JavaScript
12:09
Просмотров 1,2 млн
Coding Challenge 166: ASCII Text Images
22:42
Просмотров 1,1 млн
1.1: fetch() - Working With Data & APIs in JavaScript
15:39