Invalid column count in CSV input on line 1 Error
Fixed! I basically just selected “Import” without even making a table myself. phpMyAdmin created the table for me, with all the right column names, from the original document.
Fixed! I basically just selected “Import” without even making a table myself. phpMyAdmin created the table for me, with all the right column names, from the original document.
You report three separate problems. This is a bit of a guess into the blue, because there’s not enough information to be sure, but you should try the following: input encoding: As suggested in comments, try “utf-8-sig”. This will remove the Byte Order Mark (BOM) from your input. double quotes: Among the csv parameters, you specify quoting=csv.QUOTE_NONE. This tells the csv library … Read more
Replace ^DJI with INDU (that’s one of the tickers for the Dow) – that will work. No idea why ^DJI stopped working last weekend – someone has made a ‘negative enhancement’. Cheerio GT
You open the file in text mode. More specifically: Good guesses for encoding is “ascii” and “utf8”. You can also leave the encoding off, and it will use the system default encoding, which tends to be UTF8, but may be something else.
For identifying NaN values use boolean indexing: Then for removing all non-numeric values use to_numeric with parameter errors=’coerce’ – to replace non-numeric values to NaNs: And for remove all rows with NaNs in column x use dropna: Last convert values to ints:
Indent correctly; your for statement should be inside the with block: Outside the with block, the file is closed.
I know there is a ton of these threads but all of them are for very simple cases like 3×3 matrices and things of that sort and the solutions do not even begin to apply to my situation. So I’m trying to graph G versus l1 (that’s not an eleven, but an L1). The data … Read more
To delimit by a tab you can use the sep argument of to_csv: To use a specific encoding (e.g. ‘utf-8’) use the encoding argument:
To delimit by a tab you can use the sep argument of to_csv: To use a specific encoding (e.g. ‘utf-8’) use the encoding argument:
I think the problem is given in the error message, although it is not very easy to spot: ‘Too many indices’ means you’ve given too many index values. You’ve given 2 values as you’re expecting data to be a 2D array. Numpy is complaining because data is not 2D (it’s either 1D or None). This is a … Read more