import

Import multiple sheets from excel spreadsheet into r

谁说我不能喝 提交于 2021-02-05 11:49:58
问题 I want to import multiple sheets, selected by a common string in the sheet name, from a single .xlsx file and concatenate them into single data frame. For example, if I have an excel file ('data.xlsx') with worksheets named samples1, samples2, samples3, controls1, controls2, controls3. I want to make a list of the worksheet names, such as: sheet_list <- lapply(excel_sheets('data.xlsx'), read_excel, path = 'data.xlsx') Then, I want to import all sheets that contain 'samples' in the name and

import file but reports error NameError: name 'something' is not defined

不羁的心 提交于 2021-02-05 11:13:24
问题 testa.py class A: s1 = 333 __age = 0 def __init__(self,age ): self.__age=age return def __del__(self): return #private def __doSomething(self, s): print self.__age return #public def doSomething(self, s): self.__doSomething(s) print s test.py import sys import testa a=A(111) a.doSomething('222') run python test.py it reports error: NameError: name 'A' is not defined your comment welcome 回答1: Use a=testa.A(111) You must name the package unless you import A explicitly e.g from testa import A

R import multiple csv files

拈花ヽ惹草 提交于 2021-02-05 08:11:37
问题 I want to import multiple TSV Files (yes: T SV) in R. Reading a single file with an selection of spacific columns works well by using: data00<-read.csv(file = '/Volumes/2018/06_abteilungen/bi/analytics/tools/adobe/adobe_analytics/adobe_analytics_api_rohdaten/api_via_data_feed_auf_ftp/beispiel_datenexporte_data_feed/01sssamsung4de_20180501-000000.tsv', sep ="\t", fill = TRUE, quote='', header = FALSE )[ ,c(287, 288, 289, 290, 291, 292, 293, 304, 370, 661, 662, 812, 813, 994, 995, 1002)] Now i

How do wildcards in Java import work?

人盡茶涼 提交于 2021-02-05 05:21:55
问题 I've been noticing some unexpected results with my import s, and I'm hoping to understand what's really going on. I started with the following: import java.util.*; import java.io.*; import java.nio.*; import java.nio.file.Path; import java.nio.file.StandardOpenOption.*; import java.nio.file.Paths; and then found that ArrayList and ListIterator didn't work...so I added import java.util.ArrayList; import java.util.ListIterator; and everything works perfectly. I would have assumed that java.util

Import and usage of different package files in protobuf?

我与影子孤独终老i 提交于 2021-02-04 21:59:05
问题 I have imported an other proto which having different package name than mine. For usage of messages from other package, have accessed that message with package name. For Example : other.proto package muthu.other; message Other{ required float val = 1; } myproto.proto package muthu.test; import "other.proto"; message MyProto{ required string str = 1; optional muthu.other.Other.val = 2; } Is there a way to use val of muthu.other package directly like optional val = 2; instead of using muthu

Importing PPM images with python and PIL module

谁说我不能喝 提交于 2021-02-04 21:00:42
问题 EDIT: Actually, I need a way I can read the lines and extract the pixel info into some structure so I can use the putpixel function to create an image based on the ppm p3 file. I've been trying this for so long and I can't just get it right. I'm working with Python Imaging Library (PIL) and I want to open a PPM image and display it as an image on the screen. How can I do that using only PIL? this is my ppm image. it's just a 7x1 image that i created. P3 # size 7x1 7 1 255 0 0 0 201 24 24 24

Importing PPM images with python and PIL module

↘锁芯ラ 提交于 2021-02-04 21:00:16
问题 EDIT: Actually, I need a way I can read the lines and extract the pixel info into some structure so I can use the putpixel function to create an image based on the ppm p3 file. I've been trying this for so long and I can't just get it right. I'm working with Python Imaging Library (PIL) and I want to open a PPM image and display it as an image on the screen. How can I do that using only PIL? this is my ppm image. it's just a 7x1 image that i created. P3 # size 7x1 7 1 255 0 0 0 201 24 24 24

Tool for pinpointing circular imports in Python/Django?

风流意气都作罢 提交于 2021-02-04 09:44:31
问题 I have a Django app and somewhere in it is a recursive import that is causing problems. Because of the size of the app I'm having a problem pinpointing the cause of the circular import. I know that the answer is "just don't write circular imports" but the problem is I'm having a hard time figuring out where the circular import is coming from, so ideally a tool that traced the import back to its origin would be ideal. Does such a tool exist? Barring that, I feel like I am doing everything I

Tool for pinpointing circular imports in Python/Django?

爷,独闯天下 提交于 2021-02-04 09:44:05
问题 I have a Django app and somewhere in it is a recursive import that is causing problems. Because of the size of the app I'm having a problem pinpointing the cause of the circular import. I know that the answer is "just don't write circular imports" but the problem is I'm having a hard time figuring out where the circular import is coming from, so ideally a tool that traced the import back to its origin would be ideal. Does such a tool exist? Barring that, I feel like I am doing everything I

Tensorflow `Syntax Error: pywrap_tensorflow` After Install

蓝咒 提交于 2021-02-04 08:29:05
问题 I've setup a virtualenv and using pip installed tensorflow via sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.0-py3-none-any.whl . However, when I open a python shell to test the install I get the following error: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf Traceback (most recent call last): File "