Questions tagged [import]

The general process of moving data from an external source into one's platform, program, or data set.

Used as a general term to mean "bringing data from outside, in." It often involves modifying, converting, or truncating data to fit within the constraints of the system into which it is being moved, to translate the format of the current data into one which is more easily used by the target system, or to cut a large data set down to only data that is relevant to the person performing the import process.

In Python, the import statement is used to access objects defined in the standard library, as well as external modules and packages. Python imports are actual statements that are executed in runtime. It is possible to import a specific part of the module by using from <module> import <specific_part>. It is also possible to rename the imported object by using as.

In Java, the import statement is used to import class names from another package. In recent versions of the language, the static import statement is used to import names of static members of a specific class; i.e. static fields or methods. Unlike Python, Java imports are processed at compile time, being actually syntactic sugar (so one does not need to specify fully qualified names throughout the code).

23357 questions
6
votes
0 answers

How to Setup a C++ Module Map in Xcode?

How would one go about setting up an Xcode (6.4+) project to take advantage of C++ modules for an external C++ library that doesn't already have a module map?
Nathanael Weiss
  • 586
  • 1
  • 6
  • 22
6
votes
1 answer

Can't import pprint

Programming newbie here. Whenever I attempt to 'import pprint' in the Python IDLE, I get the following error: >>> import pprint Traceback (most recent call last): File "", line 1, in import pprint File…
Thrynn
  • 161
  • 2
  • 2
  • 10
6
votes
1 answer

Error Code: 1148. The used command is not allowed with this MySQL version

R programming language This is my query: LOAD DATA LOCAL INFILE '/home/ap_506/KF/export_2015-07-20.csv' INTO TABLE test.raporty FIELDS TERMINATED BY ';' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES; I put local-infile=1 in file:…
Taz
  • 4,945
  • 2
  • 20
  • 45
6
votes
1 answer

Why am I getting the "Valid table name is required for in, out or format" error with BCP?

I want to import a table while keeping the identity column. In cmd, I enter: bcp database.edg.Hello in C:\Users\Tech\Downloads\p.csv -c -E -S 349024ijfpok.windows.net\MSSQLSERVER -T Which returns: A valid table name is required for in, out…
user5112255
  • 71
  • 1
  • 3
6
votes
2 answers

Import C# Class

I'm (very) new to C#, and I need to know how to import classes. In Java, I could just say: package com.test; class Test {} And then in some other class: package com.test2; import com.test.Test; How could I do this in C#?
Lucas Baizer
  • 159
  • 1
  • 2
  • 9
6
votes
3 answers

openpyxl library - jdcal error

I'm trying to work on some excel files, I decided to use openpyxl library. I've copied the openpyxl folder to /Lib/ and trying to do the import command on some sample code, and all I get is a list of few errors. Traceback (most recent call…
Denis Wasilew
  • 506
  • 3
  • 8
  • 26
6
votes
6 answers

importing external ".txt" file in python

I am trying to import a text with a list about 10 words. import words.txt That doesn't work... Anyway, Can I import the file without this showing up? Traceback (most recent call last): File "D:/python/p1.py", line 9, in import…
Daniyal Durrani
  • 103
  • 1
  • 1
  • 2
6
votes
1 answer

Loading a file in common lisp

I've been learning/playing around with common lisp for some time(few months), and I still have some difficulty understanding how to import code from other files. I'm using emacs/slime and SBCL, and from what I've read, I need to use the "load"…
Charles Langlois
  • 3,968
  • 2
  • 11
  • 20
6
votes
2 answers

How to Populate a Elastic Search Index from text file?

I'm planning to use an Elastic Search index to store an huge city database with ~2.9 milion records, and use it as search engine at my Laravel Application. The question is: I both have the cities at MySQL database and at CSV File. The file have…
Elias Soares
  • 7,626
  • 4
  • 22
  • 48
6
votes
4 answers

Lexically importing useful functions in a big script

Sometimes I need a useful utility function, like List::Util::max in the middle of a large program that does lots of stuff. So if I do use List::Util 'max'; At the top of my program, I'm stuck with that symbol, polluting my whole namespace, even…
friedo
  • 62,644
  • 16
  • 111
  • 180
6
votes
1 answer

Intellij idea won't recognize import of local class in python 3

I've got a python3 script, script.py, and in it I want to instantiate a class Foobar which is defined in clazz.py. However, when I try to import, I get: $ python3 script.py ... SystemError: Parent module '' not loaded, cannot perform relative…
tytk
  • 1,680
  • 2
  • 21
  • 36
6
votes
1 answer

Why is Oracle is locking the statistics of my schema after import?

My problem is that I have a schema where the statistics of all tables are locked. I found on the Internet that I can unlock using the DBMS_STATS.UNLOCK_TABLE_STATS (SCHEMA_NAME) procedure. What I need to know is the how Oracle determines when the…
Aramillo
  • 3,116
  • 3
  • 20
  • 48
6
votes
3 answers

Import csv file into a matrix/Array in Python

I am trying to import big csv files which contain both string and numeric matrix of data into Arrays/matrices in Python. In MATLAB I used to load the file and simply assign it to a matrix but it seems to be a bit tricky in Python. Could somebody…
user3376020
6
votes
1 answer

Import Android-Gradle project into Android Studio

I'm trying to import a project that I created in another machine using Android Studio, to a new machine, using the same software. I select "Import project (Eclipse ADT, Gradle, etc.)", then select the folder, that have the following structure: …
David Magalhães
  • 622
  • 4
  • 8
  • 25
6
votes
1 answer

zipimporter can't find/load sub-modules

I'm trying to load a sub-module from a ZIP package but it won't work. How to do it right? foo.zip foo/ __init__.py bar.py test.py import os import zipimport dirname = os.path.dirname(__file__) importer =…
Niklas R
  • 14,369
  • 23
  • 82
  • 179
1 2 3
99
100