rename

How to append a string to subset of variable names in R?

风格不统一 提交于 2019-12-10 20:33:31
问题 I am trying to alter a select few of my variable names in a data frame. How can I do this without typing each of the old names and each of the new names? I thought the code below might work but it hasn't. I am trying to append "Econ" to each of the existing names identified in the data frame. names(wb.misc)[3,13,14,20,22,47,61,62,64,68,73] <- paste("Econ", names(wb.misc)[3,13,14,20,22,47,61,62,64,68,73], sep = "-") 回答1: You need to put c() around the indices names(wb.misc)[c(3,13,14,20,22,47

In Java 1.6 File.renameTo() atomic on linux?

吃可爱长大的小学妹 提交于 2019-12-10 19:30:02
问题 As the title says, in Java 1.6 File.renameTo() an atomic operation on POSIX linux? According to this link, the rename operation in POSIX Linux is atomic, however, does it hold true for FIle.renameTo? 回答1: With Linux, the rename is atomic if and only if the source path and target path are under the same mount point (not filesystem). File.renameTo() is essentially a call to rename(2) under Linux, so you'll have to test for its return value to see if the file could be renamed. With Java 7, drop

How to (re)name an empty column header in a pandas dataframe without exporting to csv

六月ゝ 毕业季﹏ 提交于 2019-12-10 18:18:10
问题 I have a pandas dataframe df1 with an index column and an unnamed series of values. I want to assign a name to the unnamed series. The only way to do this that I know so far is to export to df1.csv using: df1.to_csv("df1.csv", header = ["Signal"]) and then re-import using: pd.read_csv("df1.csv", sep=",") However, this costs time and storage space. How to do this in-memory? When I do df2 = df1.rename(columns = {"" : "Signal"}, inplace = True) I yield: AttributeError: "Series" object has no

PHP runkit_function_rename don't work?

和自甴很熟 提交于 2019-12-10 16:59:12
问题 This code don't work. Why not? <?php function test() { echo 'test'; } runkit_function_rename('test', 'test2'); test2(); ?> What I really want is this. I'm using a system that have a function. When I'm on localhost I want that function to do something different. I want to override the function with own stuff. All alternatives are welcome as well. 回答1: Do you have the PECL extension installed? http://www.php.net/manual/en/runkit.installation.php This » PECL extension is not bundled with PHP.

rename not supporting multi-byte characters

本秂侑毒 提交于 2019-12-10 14:27:45
问题 If I write: rename('php109.tmp','test.jpg'); then it's fine and working. but if I change it into: rename('php109.tmp','中文.jpg'); it'll report "No such file or directory...". But if the multi-byte characters can be written into database then can be read out, then why it fails when it is renamed ? 回答1: File systems do not necessarily use UTF-8. For instance, this is what Wikipedia says about NTFS: NTFS allows any sequence of 16-bit values for name encoding (file names, stream names, index names

Project Crashes After Rename

懵懂的女人 提交于 2019-12-10 12:44:29
问题 If I change the name of my iOS project in XCode either in in the navigator view: What is the equivalent of Project->Rename in Xcode 4 Or in the Inspector, like this: http://woolybeastsoftware.com/woolyblog/2012/01/22/xcode-4-renaming-projects/ ...XCode quits unexpectedly? Anybody run into this problem? Why does this happen and how can you avoid it? 回答1: If your Xcode project is corrupted, you can do the following, In finder, right click on your .xcodeproject file and click on show package

Changing Project Name textures render wrong : Cant reverse

老子叫甜甜 提交于 2019-12-10 12:08:45
问题 I changed the name of the app as it appears on the device under its icon by first changing the project name as suggested here. Suddenly on the simulator: the textures were not rendering correctly or could could not be found ( a large x appeared where the Sprtite Halo should of been) They were significantly freezes during run time The textures that did render were allot smaller After panicking a bit I undid the change and everything was back to normal. I then changed the name by changing the

Regular Expression in a Windows Batch File

一曲冷凌霜 提交于 2019-12-10 11:28:50
问题 I'm looking for way to rename multiple files with a batch job. Yes, I know there are many Applications around which can achieve this. But I need an automated way, something like a Batch File which I can call from a Scheduler (SOS Job Scheduler). We need to rename hundreds of files daily! The Goal is to set the 17-25 charcaters at the beginning of the file. 00010028229720270014468393_TB-E.pdf -> 00144683930001002822972027_TB-E.pdf 000100282297202700144683931ESR-AF.pdf ->

Python - Unable to rename a file with special characters in the file name

。_饼干妹妹 提交于 2019-12-10 10:34:34
问题 I have a bunch of mp3 files that somehow have a special character in the 0th index. So the file name looks like this - ▶ Alone Tonight - Radio Edit - Above & Beyond .mp3 I want to be able to fix this. In python, when I list the file, it shows up like this: '? Alone Tonight - Radio Edit - Above & Beyond .mp3' All I want to do is to rename this file with the substring defined by [2:len(filename)] However, when I do this: newfilename = filename[2:len(filename)] os.rename(filename,newfilename) I

What is the parameter “index” in Pandas.DataFrame.rename method?

江枫思渺然 提交于 2019-12-10 02:58:41
问题 Pandas DataFrame has a rename method which takes a parameter named "index." I don't understand the description of the parameter in the documentation: DataFrame.rename Specifically, I'm using it like the example on the documentation web page: df.rename(index=str, columns={"A": "a", "B": "c"}) I understand the result, but I don't understand why we set index=str . What is the index parameter used for? Why does the example set index=str ? 回答1: The index parameter is used to rename index, take df