如何将自己的数据导入Google Colab

时间:2018-11-14 12:45:42

标签: python tensorflow keras

我是python和tensorflow的新手。我想在一个用于人类活动识别的协作网络上运行我的Deep网络。 问题是我不知道如何导入我的数据集进行协作! 我已经将数据集上传到云端硬盘。 (数据集链接在下面) http://www.cis.fordham.edu/wisdm/dataset.php 我只想使用WISDM_ar_v1.1_raw.txt文件

4 个答案:

答案 0 :(得分:1)

您必须将Google驱动器安装在笔记本中

    private void SendNotification(Firebase.Messaging.RemoteMessage message)
    {
        var intent = new Intent(this, typeof(LoadingActivity));
        if (message.Data.TryGetValue("Page", out string value))
        {
            Menu page = (Menu)int.Parse(value);
            switch (page)
            {
                case Menu.Sales:
                    {
                        if (message.Data.TryGetValue("DetailId", out string SaleId))
                            intent.PutExtra("SaleId", SaleId);
                        break;
                    }
                case Menu.Recipes:
                    {
                        if (message.Data.TryGetValue("DetailId", out string RecipeId))
                            intent.PutExtra("RecipeId", RecipeId);
                        break;
                    }
                case Menu.News:
                    {
                        if (message.Data.TryGetValue("DetailId", out string NewsId))
                            intent.PutExtra("NewsId", NewsId);
                        break;
                    }
                case Menu.ExclusiveProducts:
                    {
                        if (message.Data.TryGetValue("DetailId", out string SpecialProductid))
                            intent.PutExtra("SpecialProductid", SpecialProductid);
                        break;
                    }
                case Menu.CookingAdvices:
                    {
                        if (message.Data.TryGetValue("DetailId", out string CookingAdviceId))
                            intent.PutExtra("CookingAdviceId", CookingAdviceId);
                        break;
                    }
            }
        }
        intent.AddFlags(ActivityFlags.ClearTop);
        int uniqueInt = (int)((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) & 0xfffffff);
        var pendingIntent = PendingIntent.GetActivity(this, uniqueInt, intent, PendingIntentFlags.OneShot);
        var defaultSoundUri = RingtoneManager.GetDefaultUri(RingtoneType.Notification);
        var notificationBuilder = new NotificationCompat.Builder(this)
                                                        .SetContentTitle(message.GetNotification().Title)
            .SetContentText(message.GetNotification().Body)
            .SetAutoCancel(true)
            .SetSmallIcon(Resource.Drawable.ic_launcher)
            .SetSound(defaultSoundUri)
            .SetContentIntent(pendingIntent);
        var notificationManager = (NotificationManager)GetSystemService(Service.NotificationService);
        notificationManager.Notify(0, notificationBuilder.Build());
    }

Reference

答案 1 :(得分:0)

  

column_names = ['用户ID','活动','时间戳','x轴','y轴',   'z轴']数据= pd.read_csv(('   Drive / app / WISDM_ar_latest.tar.gz / WISDM_ar_v1.1 / WISDM_ar_v1.1_raw.txt',标题   =无,名称= column_names)

  File "<ipython-input-26-033bf3a3f419>", line 2
    data = pd.read_csv(('My Drive/app/WISDM_ar_latest.tar.gz/WISDM_ar_v1.1/WISDM_ar_v1.1_raw.txt',header = None, names = column_names)
                                                                                                         ^
SyntaxError: invalid syntax

答案 2 :(得分:0)

根据your post,您有一个多余的括号会导致语法错误。试试这个

data = pd.read_csv(filepath_or_buffer = 'My Drive/app/WISDM_ar_latest.tar.gz/WISDM_ar_v1.1/WISDM_ar_v1.1_raw.txt',header = None, names = column_names)

答案 3 :(得分:0)

Okey,现在解决了! 所有您认为需要做的就是将数据上传或上传到驱动器。 (我上载了文件夹名称:“ app”) 然后

  

从google.colab导入驱动器drive.mount('/ content / drive /')

现在通过此代码,您可以导入数据:

  

data = pd.read_csv(“ / content / drive /我的云端硬盘/app/WISDM_ar_v1.1_raw.txt”)