Outils logiciels pour les cours Paris II

Cours Paris II

Stages/ Thèses/ Séminaires

Laboratoire

edit SideBar

Colab

Google Colab or "the Colaboratory" is a free Python environment in the cloud.

Getting Started

To start working with Colab, you first need to log into your google account, then go to this link https://colab.research.google.com

How to use a TD notebook from colab repertory

Step 1

Open a Python Notebook, by click on this link https://colab.research.google.com :

  • Select Github
  • Copy/Past one of this following links :

Figure 1
  1. TD1 https://github.com/alassou/TD-Up2/blob/master/TD_rwf/TD_read_write.ipynb lecture d'un grand fichier fixe "data_390000_edges.csv" et écriture d'un réservoir de taille k dans un autre fichier "data_400_edges".
  2. TD2 https://github.com/alassou/TD-Up2/blob/master/TD_WReservoir_XYTIMEOUT/TD_Write_Reservoir_XYTimeout.ipynb accès Twitter en stream sur des mots clés, et écriture d'un réservoir de taille k toutes les x minutes pour une observation de y minutes (termine normalement).
  3. TD3 https://github.com/alassou/TD-Up2/blob/master/component%20size_diameter/TD_component_size_diameter_XYTimeout_File.ipynb accès Twitter en stream sur des mots clés, et écriture du réservoir de taille k toutes les x minutes pour une observation de y minutes (termine normalement), avec affichage de l'indice de la fenêtre pour chaque fenêtre, la taille de la composante géante(nombre de nœuds, nombre d'arêtes), et le diamètre. Les composantes géantes se trouvent dans des fichiers intermédiaires dans le dossier sample_data de colab.
  4. TD4 https://github.com/alassou/TD-Up2/blob/master/component%20size_diameter/TD_component_size_XYTimeout_Diameter.ipynb le même programme que 3 sauf qu'on ne stocke plus les fichiers intermédiaires.
  5. TD5 https://github.com/alassou/TD-Up2/blob/master/TD5/Copie_de_TD5_nv.ipynb accès Twitter en stream sur des mots clés comme précédemment et lecture d'une valeur boursière pour chaque fenêtre sur le serveur de yahoo_finance. Des exemples: Indices boursiers Stock ticker (e.g. CAC40: '^FCHI', Microsoft Corporation: 'MSFT', Amazon: 'AMZN', Netflix: 'nflx', Apple: 'AAPL') etc.)
  6. TD6 https://github.com/alassou/TD-Up2/blob/master/TD6/Copie_de_TD_5456.ipynb accès Twitter en stream sur des mots clés,comme le programme 5 sauf en plus on va mettre toutes les informations pour chaque fenêtre dans un fichier intermédiaire comme dans le 3.
  7. TD7 https://github.com/alassou/TD-Up2/blob/master/Copie_de_newtest_dashboard_2tickers_comment.ipynb accès Twitter en stream sur des mots clés,comme le programme 6 sauf en plus on va rajouter le dashboard avec les graphiques. Pour lancer le programme, il y a 5 interactions: 2 Setup, Clés, tickers, Twitter Streaming. Une activation manquante génèrera un message d'erreur.

======= >>>>>>>

Link with Google drive

After you open a Notebook, save it in your drive: "Enregistrer dans Google drive".

You can see your files in the directory 'Colab Notebooks'.

To see your "drive" files in colab, you need to "mount" the drive.

Step 2

Initial Setup :

  • Run "Setup" below first.
    • This will load libraries and download some resources that we'll use throughout the tutorial.
    • You will see a message reading "Done with setup!" when this process completes.

Figure 2

Step 3

You should add your own keys below and then run the code block to set your keys:


Figure 3

Step 4

To run the Python script step by step, you need to execute cells as follow =>


Figure 4

Step 5

To download data, you must do this =>


Figure 5

After running this program, you can run gephi to play with the network graph. For more informations about Gephi, please read this page http://www.up2.fr/index.php?n=Main.Gephi

FAQ

How can i see all the code ?


Figure 6
UP2