Automating Crypto Website API Pull Using Python | Data Analyst Project

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 102

  • @krystlestevens2585
    @krystlestevens2585 Рік тому +82

    TIP: around 12:17 when you run the API runner for the first time, I had to replace "df = df2.append(df2)" with
    df_append = pd.DataFrame(df2)
    df = pd.concat([df2,df_append])
    because frame.append is deprecated; new format is panda.concat. I kept getting an annoying little warning message that I didn't want to show every time the runner was successful.
    I typed this out on my own after a little research and I have to give a HUGE shoutout to Alex for the videos. I am FAR from versed in Python.... Just a little research and trial and error. Hope this helps someone!

    • @krystlestevens2585
      @krystlestevens2585 Рік тому +14

      And at 14:25 when the error is detected & corrected (LOL), here's the update I made to the correction:
      df_append = pd.DataFrame(df2)
      df = pd.concat([df,df_append])
      Worked perfectly.

    • @pampam3835
      @pampam3835 Рік тому +2

      thank you! this helps me so much!

    • @lydiapuspita5870
      @lydiapuspita5870 Рік тому +1

      @@krystlestevens2585 thank you for these tips, I'm also experiencing the same thing

    • @John-dy9th
      @John-dy9th Рік тому

      @@krystlestevens2585 Really helpful! Thank you. One question: Every time I run api_runner() it still prints out the unorganized data. Were you able to just print 'API Runner Complete" without all the data each time? Here is my code so you can see if I messed anything up:
      df2 = pd.json_normalize(data['data'])
      df2['timestamp'] = pd.to_datetime('now')
      df_append = pd.DataFrame(df2)
      df = pd.concat([df2, df_append])
      import os
      from time import time
      from time import sleep
      for i in range(333):
      api_runner()
      print('API Runner Fetch Completed')
      sleep(30)
      exit()

    • @user-fw3vv4id5z
      @user-fw3vv4id5z Рік тому +1

      Thank youuu

  • @EuroJizz
    @EuroJizz 2 роки тому +3

    Great demo Alex. As someone who is nearing the end of my DA degree and starting to put together a portfolio this really helped!

  • @haiderabbas4490
    @haiderabbas4490 Рік тому +2

    Well 27:25, another way you can achieve removing scientific notation is by
    pd.options.display.float_format = '{:,.2f}'.format
    and just hit shift+enter in jupyter.

  • @riteshsinha9891
    @riteshsinha9891 2 роки тому +7

    very good content Alex. Keep it up.
    suggestion: the reset_index() will automatically generated sequential numbers so there's no need to created number sequence for indexing purpose. directly call the reset_index() function

  • @dubeyrohit90
    @dubeyrohit90 Рік тому +3

    I am always smiling when Alex makes mistakes keep them in the videos, because I make them too. Same for spelling mistakes. Haha. :)

  • @PlatypusIRE
    @PlatypusIRE 2 роки тому +3

    These sort of video's are exactly what I'm looking for!!! Don't have time to go throught them at the moment, but am bookmarking them for the weekend!
    Keep it up!

  • @gebrilaboubakr8402
    @gebrilaboubakr8402 2 роки тому +2

    fantastic, even if i didn't see it. coz you're the one who is doing great videos.

  • @careerfoundry
    @careerfoundry 2 роки тому +1

    This is extremely insightful, Alex! Great video and follow up from last week's video!

  • @nikssssss847
    @nikssssss847 Рік тому +1

    This is very helpful Alex. Thanks and lots of love from India.

  • @Call-me-Avi
    @Call-me-Avi 2 роки тому +2

    Thank you for this, dear unknown person.

  • @69nukeee
    @69nukeee 10 місяців тому

    Awesome video! You explain everything very clearly. I also dig you are showing the errors!
    You are the man! 🤜🤛

  • @felixc.programs8209
    @felixc.programs8209 2 роки тому

    Love your content! You motivated me to start my own Tech UA-cam channel and I hope one day it will grow like yours did. That's it ,just thank you!

  • @KeyserTheRedBeard
    @KeyserTheRedBeard 2 роки тому +1

    cool upload Alex The Analyst. I crushed that thumbs up on your video. Keep up the very good work.

  • @ayodejianibaba288
    @ayodejianibaba288 2 роки тому

    Loved this❤️💯, thank you Alex😊used to think automation was a mountain now you’ve broken that barrier 🥂

  • @lody33100
    @lody33100 2 роки тому +1

    Great topic as usual, waiting...

  • @vinothp6952
    @vinothp6952 Місяць тому

    00:01 Automating data collection from a crypto API using Python
    02:38 Adding timestamp to automation scripts for tracking run time
    08:25 Automating the process of appending data frames and creating a loop for automatic execution.
    11:32 Automating API calls to run every minute
    17:03 Automating data export to CSV from API response using Python
    19:48 Automating file creation and data appending using Python
    25:30 Exploring data visualization and transformation using Python for crypto website API
    28:27 Grouping data in Python using Pandas groupby function
    34:25 Convert series to data frame in Python
    37:13 Resetting index for proper data formatting
    43:14 Updating and visualizing crypto data for different time frames
    46:08 Creating Dataframe and Querying Data in Python for Cryptocurrency Prices
    Crafted by Merlin AI.

  • @zainab_saeed
    @zainab_saeed 11 місяців тому

    Thank you so much Alex, I've just completed the project successfully 👍

  • @neildelacruz6059
    @neildelacruz6059 11 місяців тому +1

    Thank you Alex, really great piece.

  • @jayashukla4799
    @jayashukla4799 2 роки тому +3

    Thanks a ton, Alex! What did I do to deserve this🥺?!! How do you make things this easy!

  • @user-sl7wl2kh9w
    @user-sl7wl2kh9w 9 місяців тому +4

    hello, can someone tell me why do i have only 1 timestamt at 48:15 ?

    • @janrelleelam3628
      @janrelleelam3628 4 місяці тому

      I had the same issue, I used df7.query instead of df10.query and then all of the values appeared. So instead of df10=df10.query("name=='Bitcoin'") try df10=df7.query("name=='Bitcoin'") and see if that works.

    • @matthewchristian9969
      @matthewchristian9969 29 днів тому

      ensure your dataframe(df) is updating and not commented out in the api_runner function with line: df = pd.concat([df,df_append])

  • @hykze
    @hykze Рік тому

    Pls i need more site with APIs
    Thanks alex ...u are good

  • @cannalibrium4025
    @cannalibrium4025 9 місяців тому

    Was there ever a follow up video with more on the data visualization part? Thank you! Great video!

  • @cantblockjo3193
    @cantblockjo3193 2 роки тому

    Absolutely love this! Please tell me a webscrapping tutorial is in the works 🙏🏿🤞🏿

  • @harshalmahajan6470
    @harshalmahajan6470 2 роки тому +5

    Hi Alex
    You are doing great job. I would request you to make project on SQL and power bi (complex one, big dataset and multiple tables)

    • @Zain-ng1oq
      @Zain-ng1oq 2 роки тому

      Hes already made an sql project palv

    • @AlexTheAnalyst
      @AlexTheAnalyst  2 роки тому +8

      I plan on doing some larger, full scale projects once I finish the Python beginner tutorial series. I'll definitely be making more complex, challenging projects for people to try out :)

  • @ildacengu1468
    @ildacengu1468 Рік тому +1

    Alex, can u please put the "How to use a Public API" video on the bootcamp? I was searching for it and I couldn't find and being frustrated cause I couldn't understand where this video was,since I followed all the bootcamp videos until this one,and I didn't go through it.
    Thanks God u have shown the link above, and in a moment I saw it.

  • @nayeem3905
    @nayeem3905 2 роки тому

    Alex, great video as usual. I do have a topic for you if you like to discuss in another video. How much statistics is required for a data analyst to know? Maybe do a comparison to a data scientist

  • @vimalrathod9026
    @vimalrathod9026 2 роки тому +1

    Hey Alex, It was a great video and I am gonna tweak and experiment a bit with it on my end. I have a question though. While automating the script, how are we gonna update our API key? Can we use just one API key 333 times a day and we'll be getting fresh updated data every time our script runs? Or are we gonna get 333 different API keys for each time our script runs? In either case, how would we be updating our API key?

  • @dataisfun4964
    @dataisfun4964 2 роки тому

    Awesome Alex!!!

  • @jatinnimawat9281
    @jatinnimawat9281 2 роки тому

    Dude, you are the best :)

  • @bobbyvasquez4525
    @bobbyvasquez4525 Рік тому +1

    How does one at 48:35 get to shorten the timestamps labled at the bottom. Mine are super messy, similar to the percent change before we changed it.

    • @LionelEnyimba
      @LionelEnyimba Рік тому

      sns.set_theme(style= 'darkgrid') # or sns.set_style('darkgrid')
      axes = sns.lineplot(x='timestamp', y='quote.USD.price', data=df11)
      axes.set_xticklabels(ax.get_xticklabels(), rotation=45); 🙌🏽
      That sorted it out the messy x axis but you may get a warning message.

  • @HBodyWMind
    @HBodyWMind 2 роки тому +2

    Just checking. Will there be a playback version of this video?

    • @AlexTheAnalyst
      @AlexTheAnalyst  2 роки тому +2

      Yep - once it "Premiers" it says it will go up as a regular video just like normal.

  • @digitalnomad2196
    @digitalnomad2196 9 місяців тому

    Is there a part 2 to this video ? cheers

  • @jordanmcgregor7788
    @jordanmcgregor7788 2 роки тому

    I don't know how many hours you spend preparing each of these but I am sure it is a non-trivial amount! I am curious, how much Python do you use on a day-to-day basis?

    • @AlexTheAnalyst
      @AlexTheAnalyst  2 роки тому +1

      A 5-10 hours or so I would say - and I used to use it a lot, but in my manager role not a lot.

  • @yanpaucon1043
    @yanpaucon1043 2 місяці тому

    Help Please ! 44:16
    UserWarning: The figure layout has changed to tight
    self._figure.tight_layout(*args, **kwargs)
    Thank you..

  • @LH11BULLET
    @LH11BULLET 2 роки тому

    Hi Alex, great video. I am working on this project while the video plays but it seems as though I reach the daily credit limit after running the script for 4 completions. Do you have any suggestions on how to resolve this?

  • @PrachiVarshney-p2f
    @PrachiVarshney-p2f 2 місяці тому

    UserWarning: Creating legend with loc="best" can be slow with large amounts of data.
    self._figure.tight_layout(*args, **kwargs)
    i am getting this error on 41:09 . Help me if anybody knows please .

  • @lalchandrankr2576
    @lalchandrankr2576 Рік тому

    hey Alex, running the program not saved by the excel format

  • @Denees7
    @Denees7 2 роки тому

    My kernel keeps dying while running api_runner . What should I do?
    I tried many times, even tried to virtual env

  • @godfredansah6233
    @godfredansah6233 2 роки тому

    Hello Alex. I'm Godfred and i just join your channel cos your doing extremely well with the education but my problem is not about this particular video but Excel. Pls I wanna know if there is any way I can learn the excel vidoes without laptop? cos I was finding it difficult in understanding and yet and I'm also interested in the course.😥

  • @deepaksai3806
    @deepaksai3806 Рік тому

    Does Transposing DataFrame help while changing the columns to rows?

  • @sarthakdhaneshwar678
    @sarthakdhaneshwar678 2 роки тому

    Hi Alex! Can you share how to upload files from a folder using API of a website?

  • @c.n217
    @c.n217 2 роки тому +1

    hey there I am a stay at home mom and would love to teach myself everything there is to learn to in data and possibly in the near future get a data analyst job. If you could recommend a platform or just 1 program could you please tell me which one you would recommend and why? it is very overwhelming seeing all these options online, I have also read many reviews of people who did the google cert and didn;t get any luck getting a entry level job as an analyst . I plan on choosing a platform and your videos for practice. Thank you in advance

    • @AlexTheAnalyst
      @AlexTheAnalyst  2 роки тому

      I'd probably look at Coursera - if you're just starting out you can look at the IBM Data Analyst specialization or the Google Data Analyst Certification on Coursera. Both are pretty good for beginners and have a good path to learn.

  • @francescab1413
    @francescab1413 9 місяців тому

    anyone getting "UnboundLocalError: cannot access local variable 'df' where it is not associated with a value" when running the for loop?

  • @snehalsanap1750
    @snehalsanap1750 2 роки тому

    @Alex The Analyst hi I need your help I was going through your SQL based project in this series but can you tell how to upload that to my resume and github

  • @sdivi6881
    @sdivi6881 5 місяців тому

    Can someone explain why it is range(333) given? I mean how to calculate this 333

    • @tinah426
      @tinah426 5 місяців тому +1

      It is the daily limit usage of the API key.

  • @akash_AKASH1
    @akash_AKASH1 6 місяців тому

    what is wrong im not able to understand. import os
    from time import time
    from time import sleep
    for i in range(333):
    api_runner()
    print('API Runner completed')
    sleep(60) #sleep for 1 minute
    exit() stuck in this part again and again. AttributeError: 'DataFrame' object has no attribute 'append', this is error i get everytime

    • @shamram7510
      @shamram7510 4 місяці тому

      Refer to the comment above, append is no longer available

    • @shamram7510
      @shamram7510 4 місяці тому

      Use concat

    • @shamram7510
      @shamram7510 4 місяці тому

      Df= pd.concat([df,df_append])

  • @ibhadeimanatue3367
    @ibhadeimanatue3367 2 роки тому

    My Seaborn catplot is not showing, please what can I do?

  • @miagobeli-starr
    @miagobeli-starr Рік тому

    My lineplot didn’t make a line on the graph 🥲 any ideas on how to fix this? 🙏🏼

    • @matthewchristian9969
      @matthewchristian9969 29 днів тому

      ensure your dataframe(df) is updating and not commented out in the api_runner function with line: df = pd.concat([df,df_append])

  • @vinaykumarkondisetty7991
    @vinaykumarkondisetty7991 2 роки тому

    Can you please do pyspark tutorials for us jus like you did SQL @alex

  • @xluyyjhfg
    @xluyyjhfg Рік тому

    What the Heyll!?!?

  • @monkeychunkystinkywinky
    @monkeychunkystinkywinky Рік тому

    okay, bald!! disliked

  • @lydiapuspita5870
    @lydiapuspita5870 Рік тому +1

    I got an error here --> sns.lineplot(x='timestamp', y='quote.USD.price', data = df8)
    because:
    ValueError Traceback (most recent call last)
    Input In [48], in ()
    1 sns.set_theme(style='darkgrid')
    ----> 2 sns.lineplot(x='timestamp', y='quote.USD.price', data = df8)
    File ~\anaconda3\lib\site-packages\seaborn\_decorators.py:46, in _deprecate_positional_args..inner_f(*args, **kwargs)
    36 warnings.warn(
    37 "Pass the following variable{} as {}keyword arg{}: {}. "
    38 "From version 0.12, the only valid positional argument "
    (...)
    43 FutureWarning
    44 )
    45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
    ---> 46 return f(**kwargs)
    what should I do

    • @barkamolurinboev6311
      @barkamolurinboev6311 Рік тому

      df = df.reset_index()

    • @juliohernandez4890
      @juliohernandez4890 Рік тому +1

      @@barkamolurinboev6311 thanks for your help, where I have to reset it, bc only works like one time and no more, even I'm resetting, but for sure another question is which one df I have to reset? Thanks.

  • @teox4571
    @teox4571 Рік тому +3

    Thanks, @AlexTheAnalyst! I love your bootcamp!
    I also have a trouble:
    df10 = df[['name','quote.USD.price','timestamp']]
    df10 = df10.query("name == 'Bitcoin'")
    df10.
    You have 5 outputs, but I always have only one:
    name quote.USD.price timestamp
    0 Bitcoin 30619.117651 2023-07-11 23:18:07.626573+00:00
    Can you advise me please, how to fix it? Thanks!