Python酷庫之旅-第三方庫Pandas(004)

目錄

一、用法精講

5、pandas.DataFrame.to_csv函數

5-1、語法

5-2、參數

5-3、功能

5-4、返回值

5-5、說明

5-6、用法

5-6-1、代碼示例

5-6-2、結果輸出

6、pandas.read_fwf函數

6-1、語法

6-2、參數

6-3、功能

6-4、返回值

6-5、說明

6-6、用法

6-6-1、代碼示例

6-6-2、結果輸出?

二、推薦閱讀

1、Python筑基之旅

2、Python函數之旅

3、Python算法之旅

4、Python魔法之旅

5、博客個人主頁

一、用法精講

5、pandas.DataFrame.to_csv函數
5-1、語法
# 5、pandas.DataFrame.to_csv函數
DataFrame.to_csv(path_or_buf=None, *, sep=',', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, mode='w', encoding=None, compression='infer', quoting=None, quotechar='"', lineterminator=None, chunksize=None, date_format=None, doublequote=True, escapechar=None, decimal='.', errors='strict', storage_options=None)
Write object to a comma-separated values (csv) file.Parameters:
path_or_bufstr, path object, file-like object, or None, default None
String, path object (implementing os.PathLike[str]), or file-like object implementing a write() function. If None, the result is returned as a string. If a non-binary file object is passed, it should be opened with newline=’’, disabling universal newlines. If a binary file object is passed, mode might need to contain a ‘b’.sepstr, default ‘,’
String of length 1. Field delimiter for the output file.na_repstr, default ‘’
Missing data representation.float_formatstr, Callable, default None
Format string for floating point numbers. If a Callable is given, it takes precedence over other numeric formatting parameters, like decimal.columnssequence, optional
Columns to write.headerbool or list of str, default True
Write out the column names. If a list of strings is given it is assumed to be aliases for the column names.indexbool, default True
Write row names (index).index_labelstr or sequence, or False, default None
Column label for index column(s) if desired. If None is given, and header and index are True, then the index names are used. A sequence should be given if the object uses MultiIndex. If False do not print fields for index names. Use index_label=False for easier importing in R.mode{‘w’, ‘x’, ‘a’}, default ‘w’
Forwarded to either open(mode=) or fsspec.open(mode=) to control the file opening. Typical values include:‘w’, truncate the file first.‘x’, exclusive creation, failing if the file already exists.‘a’, append to the end of file if it exists.encodingstr, optional
A string representing the encoding to use in the output file, defaults to ‘utf-8’. encoding is not supported if path_or_buf is a non-binary file object.compressionstr or dict, default ‘infer’
For on-the-fly compression of the output data. If ‘infer’ and ‘path_or_buf’ is path-like, then detect compression from the following extensions: ‘.gz’, ‘.bz2’, ‘.zip’, ‘.xz’, ‘.zst’, ‘.tar’, ‘.tar.gz’, ‘.tar.xz’ or ‘.tar.bz2’ (otherwise no compression). Set to None for no compression. Can also be a dict with key 'method' set to one of {'zip', 'gzip', 'bz2', 'zstd', 'xz', 'tar'} and other key-value pairs are forwarded to zipfile.ZipFile, gzip.GzipFile, bz2.BZ2File, zstandard.ZstdCompressor, lzma.LZMAFile or tarfile.TarFile, respectively. As an example, the following could be passed for faster compression and to create a reproducible gzip archive: compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}.New in version 1.5.0: Added support for .tar files.May be a dict with key ‘method’ as compression mode and other entries as additional compression options if compression mode is ‘zip’.Passing compression options as keys in dict is supported for compression modes ‘gzip’, ‘bz2’, ‘zstd’, and ‘zip’.quotingoptional constant from csv module
Defaults to csv.QUOTE_MINIMAL. If you have set a float_format then floats are converted to strings and thus csv.QUOTE_NONNUMERIC will treat them as non-numeric.quotecharstr, default ‘"’
String of length 1. Character used to quote fields.lineterminatorstr, optional
The newline character or character sequence to use in the output file. Defaults to os.linesep, which depends on the OS in which this method is called (’\n’ for linux, ‘\r\n’ for Windows, i.e.).Changed in version 1.5.0: Previously was line_terminator, changed for consistency with read_csv and the standard library ‘csv’ module.chunksizeint or None
Rows to write at a time.date_formatstr, default None
Format string for datetime objects.doublequotebool, default True
Control quoting of quotechar inside a field.escapecharstr, default None
String of length 1. Character used to escape sep and quotechar when appropriate.decimalstr, default ‘.’
Character recognized as decimal separator. E.g. use ‘,’ for European data.errorsstr, default ‘strict’
Specifies how encoding and decoding errors are to be handled. See the errors argument for open() for a full list of options.storage_optionsdict, optional
Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc. For HTTP(S) URLs the key-value pairs are forwarded to urllib.request.Request as header options. For other URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are forwarded to fsspec.open. Please see fsspec and urllib for more details, and for more examples on storage options refer here.Returns:
None or str
If path_or_buf is None, returns the resulting csv format as a string. Otherwise returns None.
5-2、參數

5-2-1、path_or_buf(可選,默認值為None)指定要寫入的文件路徑(字符串或路徑對象)或任何文件狀對象。如果為None,則輸出將作為字符串返回,而不是寫入文件。

5-2-2、sep(可選,默認值為',')字段之間的分隔符,可以根據需要更改為其他字符,如制表符('\t')用于制表符分隔的值(TSV)。

5-2-3、na_rep(可選,默認值為'')缺失值(NaN)的表示,你可以指定任何你想要的字符串來表示缺失值。

5-2-4、float_format(可選,默認值為None)浮點數的格式字符串。例如,'%.2f'會將浮點數格式化為保留兩位小數的字符串。

5-2-5、columns(可選,默認值為None)要寫入的列名列表。如果為None,則寫入所有列。

5-2-6、header(可選,默認值為True)是否將列名寫入文件作為第一行。如果為False,則不寫入列名;也可以是一個字符串列表,用于指定要作為文件頭部寫入的列名(注意:這可能會改變列的順序)。

5-2-7、index(可選,默認值為True)是否將行索引寫入文件。如果為False,則不寫入索引。

5-2-8、index_label(可選,默認值為None)如果需要,可以使用此參數來更改索引列的列名。如果為False,則不寫入索引名稱。如果為字符串或字符串序列,則用作索引的列名。

5-2-9、mode(可選,默認值為'w')文件打開模式,若執行寫入模式,如果文件已存在則覆蓋。

5-2-10、encoding(可選,默認值為None)指定文件的編碼方式。

5-2-11、compression(可選,默認值為'infer')指定壓縮的字符串(如'gzip'、'bz2'、'zip'、'xz'),或者一個包含壓縮選項的字典。如果為'infer'并且文件擴展名是.gz、.bz2、.zip或.xz,則自動推斷壓縮方式。

5-2-12、quoting(可選,默認值為None)控制字段中引號的使用。

5-2-13、quotechar(可選,默認值為"")引號字符,用于包圍字段中的特殊字符。

5-2-14、lineterminator(可選,默認值為None)行結束符。

5-2-15、chunksize(可選,默認值為None)如果設置了,則文件將被寫入指定的塊大小,這對于大文件可能很有用,因為它可以減少內存使用量。

5-2-16、date_format(可選,默認值為None)日期時間對象的格式字符串。

5-2-17、doublequote(可選,默認值為True)控制是否將字段內的quotechar(引號字符)加倍(即當字段內容中已包含引號字符時,使用雙引號來包圍該字段),這在處理需要被引號包圍且內容中已包含引號的字段時非常有用。

5-2-18、escapechar(可選,默認值為None)轉義字符,用于轉義引號字符(如果quoting參數不是csv.QUOTE_NONE且字段中包含引號字符時)。如果指定了escapechar,則quotechar字符前的escapechar會被用來轉義quotechar,而不是加倍quotechar。

5-2-19、decimal(可選,默認值為'.')用于表示浮點數的小數點字符,這在處理不同地域的數據時非常有用,因為某些地區可能使用逗號(,)作為小數點字符。

5-2-20、errors(可選,默認值為'strict')指定如何處理編碼錯誤。有效選項包括'strict'、'ignore'、'replace'、'surrogatepass'等,'strict'(默認值)將引發異常,'ignore'將忽略錯誤,'replace'將使用?替換錯誤字符,'surrogatepass'將允許通過代理對(surrogate pairs)表示UTF-16字符,這可能在某些情況下導致不可預見的錯誤。

5-2-21、storage_options(可選,默認值為None)對于支持額外存儲選項的文件系統(如S3、GCS等),此參數允許你傳遞額外的選項給底層的存儲系統。例如,在寫入S3時,你可以使用storage_options={'key':'secret','bucket_name':'mybucket'}來傳遞認證信息和桶名。

5-3、功能

????????將DataFrame中的數據寫入到指定的文件路徑或文件狀對象中。

5-4、返回值

5-4-1、如果path_or_buf參數是一個文件路徑或文件狀對象,則DataFrame.to_csv()函數通常沒有返回值(即返回None),因為它直接將數據寫入到指定的文件中。

5-4-2、如果path_or_buf參數為None,則函數返回一個字符串,該字符串包含了DataFrame的CSV表示形式,這允許你在不直接寫入文件的情況下獲取CSV格式的字符串數據。

5-5、說明

? ? ? ? 無

5-6、用法
5-6-1、代碼示例
# 5、pandas.DataFrame.to_csv函數
# 5-1、無返回值
import pandas as pd
# 創建一個簡單的DataFrame
df = pd.DataFrame({'Name': ['Alice', 'Bob', 'Charlie'],'Age': [24, 27, 22],'City': ['New York', 'Los Angeles', 'Chicago']
})
# 將DataFrame導出為CSV文件
csv_str = df.to_csv('people.csv', index=False)  # 注意:這里沒有返回值
print(csv_str)# 5-2、有返回值
import pandas as pd
# 創建一個包含數據的字典
data = {'Name': ['Alice', 'Bob', 'Charlie'],'Age': [24, 27, 22],'City': ['New York', 'Los Angeles', 'Chicago']
}
# 使用字典創建DataFrame
df = pd.DataFrame(data)
# 將DataFrame轉換為CSV格式的字符串
# index=False: 不包含行索引
# sep=';': 使用分號作為分隔符
# na_rep='N/A': 用'N/A'表示缺失值
# line_terminator='\n': 使用換行符分隔行
csv_string = df.to_csv(index=False, sep=';', na_rep='N/A', lineterminator='\n')
# 打印CSV字符串
print(csv_string)# 5-3、指定文件路徑
import pandas as pd
data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [24, 27, 22], 'City': ['New York', 'Los Angeles', 'Chicago']}
df = pd.DataFrame(data)
csv_string = df.to_csv('data.csv', index=False)
print(csv_string)# 5-4、使用文件對象
import pandas as pd
data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [24, 27, 22], 'City': ['New York', 'Los Angeles', 'Chicago']}
df = pd.DataFrame(data)
with open('data.csv', 'w') as file:csv_string = df.to_csv(file, index=False)
print(csv_string)# 5-5、使用StringIO
import pandas as pd
from io import StringIO
data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [24, 27, 22], 'City': ['New York', 'Los Angeles', 'Chicago']}
df = pd.DataFrame(data)
buffer = StringIO()
df.to_csv(buffer, index=False)
csv_string = buffer.getvalue()
print(csv_string)
5-6-2、結果輸出
# 5-1、無返回值
None# 5-2、有返回值
Name;Age;City
Alice;24;New York
Bob;27;Los Angeles
Charlie;22;Chicago# 5-3、指定文件路徑
None# 5-4、使用文件對象
None# 5-5、使用StringIO
Name,Age,City
Alice,24,New York
Bob,27,Los Angeles
Charlie,22,Chicago
6、pandas.read_fwf函數
6-1、語法
# 6、pandas.read_fwf函數
pandas.read_fwf(filepath_or_buffer, *, colspecs='infer', widths=None, infer_nrows=100, dtype_backend=_NoDefault.no_default, iterator=False, chunksize=None, **kwds)
Read a table of fixed-width formatted lines into DataFrame.Also supports optionally iterating or breaking of the file into chunks.Additional help can be found in the online docs for IO Tools.Parameters:
filepath_or_bufferstr, path object, or file-like object
String, path object (implementing os.PathLike[str]), or file-like object implementing a text read() function.The string could be a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, a host is expected. A local file could be: file://localhost/path/to/table.csv.colspecslist of tuple (int, int) or ‘infer’. optional
A list of tuples giving the extents of the fixed-width fields of each line as half-open intervals (i.e., [from, to[ ). String value ‘infer’ can be used to instruct the parser to try detecting the column specifications from the first 100 rows of the data which are not being skipped via skiprows (default=’infer’).widthslist of int, optional
A list of field widths which can be used instead of ‘colspecs’ if the intervals are contiguous.infer_nrowsint, default 100
The number of rows to consider when letting the parser determine the colspecs.dtype_backend{‘numpy_nullable’, ‘pyarrow’}, default ‘numpy_nullable’
Back-end data type applied to the resultant DataFrame (still experimental). Behaviour is as follows:"numpy_nullable": returns nullable-dtype-backed DataFrame (default)."pyarrow": returns pyarrow-backed nullable ArrowDtype DataFrame.New in version 2.0.**kwdsoptional
Optional keyword arguments can be passed to TextFileReader.Returns:
DataFrame or TextFileReader
A comma-separated values (csv) file is returned as two-dimensional data structure with labeled axes.
6-2、參數

6-2-1、filepath_or_buffer(必須)字符串或文件對象,表示要讀取的文件路徑或文件對象。如果是文件路徑,需要確保Pandas能夠訪問到這個文件。

6-2-2、colspecs(可選,默認值為'infer')指定列寬的規范。可以是一個整數列表,表示每列的起始位置(索引從0開始),或者是一個元組列表,每個元組包含兩個整數,分別表示每列的起始和結束位置(不包括結束位置)。如果設置為 'infer',Pandas會嘗試自動推斷列寬。

6-2-3、widths(可選,默認值為None)與colspecs參數類似,但widths接收的是一個整數列表,直接指定每列的寬度(即每列的結束位置相對于起始位置的偏移量)。如果同時指定了colspecs和widths,則colspecs會被優先使用。

6-2-4、infer_nrows(可選,默認值為100)用于推斷列寬時讀取的行數。當colspecs='infer'時,Pandas會讀取文件的前infer_nrows行來嘗試推斷出列寬,這個值可以根據文件大小和復雜性進行調整。

6-2-5、dtype_backend(可選)這個參數通常不需要用戶直接設置,它是用來指定數據類型推斷的后端,Pandas內部使用它來優化數據類型的推斷過程。

6-2-6、iterator(可選,默認值為False)布爾值,如果設置為True,則返回一個TextFileReader對象,該對象可以迭代地讀取文件塊(chunk),而不是一次性將整個文件讀入內存,這對于處理大文件很有用。

6-2-7、chunksize(可選,默認值為None)當iterator=True時,這個參數指定了每個文件塊(chunk)的行數。如果設置為None,則chunksize會被設置為infer_nrows的值。

6-2-8、*kwds(可選)其他關鍵字參數,這些參數會傳遞給底層的TextParser對象。常用的有header(指定列名的行位置,默認為None,表示沒有列名)、names(自定義的列名列表,當文件中沒有列名時使用)等。

6-3、功能

????????將固定寬度格式的文本文件解析成Pandas的DataFrame對象。

6-4、返回值

????????返回值是一個DataFrame對象。

6-5、說明

????????從Pandas 1.0.0開始,dtype_backend參數已被棄用,并且可能在未來的版本中移除。在大多數情況下,用戶不需要直接設置這個參數。

6-6、用法
6-6-1、代碼示例
# 6、pandas.read_fwf函數
# 6-1、創建測試用的.txt文件
# 直接使用Python的文件操作寫入字符串
with open('example.txt', 'w') as f:f.write('12345John Doe  25  New York\n')f.write('67890Jane Smith30  Los Angeles\n')# 6-2、基礎用法
import pandas as pd
# 假設列寬分別為 5, 10, 2, 14
colspecs = [(0, 5), (5, 15), (15, 17), (17, 31)]
# 讀取文件
df = pd.read_fwf('example.txt', colspecs=colspecs, header=None, names=['ID', 'Name', 'Age', 'City'])
# 顯示DataFrame
print(df)# 6-3、自動推斷列寬
import pandas as pd
# 嘗試自動推斷列寬,這里假設前100行足夠用來推斷
df = pd.read_fwf('example.txt', colspecs='infer', header=None, names=['ID', 'Name', 'Age', 'City'], infer_nrows=100)
# 顯示DataFrame
print(df)# 6-4、使用widths參數
import pandas as pd
# 使用 widths 參數指定列寬
widths = [5, 10, 2, 14]  # 分別對應ID, Name, Age, City的寬度
# 讀取文件
df = pd.read_fwf('example.txt', widths=widths, header=None, names=['ID', 'Name', 'Age', 'City'])
# 顯示DataFrame
print(df)
6-6-2、結果輸出?
# 6-1、創建測試用的.txt文件
# None# 6-2、基礎用法
#       ID        Name  Age         City
# 0  12345    John Doe   25     New York
# 1  67890  Jane Smith   30  Los Angeles# 6-3、自動推斷列寬
#           ID     Name  Age     City
# 0  12345John  Doe  25  New     York
# 1  67890Jane  Smith30  Los  Angeles# 6-4、使用widths參數
#       ID        Name  Age         City
# 0  12345    John Doe   25     New York
# 1  67890  Jane Smith   30  Los Angeles

二、推薦閱讀

1、Python筑基之旅
2、Python函數之旅
3、Python算法之旅
4、Python魔法之旅
5、博客個人主頁

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/40069.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/40069.shtml
英文地址,請注明出處:http://en.pswp.cn/web/40069.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

如何在不知道密碼的情況下卸載卡巴斯基

卸載 Kaspersky Endpoint Security 雖然關閉/卸載 Kaspersky Endpoint Security 需要輸入管理員賬號和密碼,但是!Kaspersky Endpoint Security 對于其應用是否應該啟用密碼保護,僅僅是通過在注冊表中的一個標志位進行判斷的,因此…

05-《豬籠草》

豬籠草 豬籠草是豬籠草屬全體物種的總稱。屬于熱帶食蟲植物,原產地主要為舊大陸熱帶地區。其擁有一個獨特的吸取營養的器官——捕蟲籠,捕蟲籠呈圓筒形,下半部稍膨大,籠口上具有蓋子,因其形狀像豬籠而得名。 豬籠草 形…

昂首平臺一分鐘理清VSA理論的市場階段

VSA的英文全程是volume spread analysis,翻譯過來就是成交量價格幅度差分析,從名字角度就也可以重點看出,VSA分析法主要是從成交量供應分析來分析。但是很多投資者不理解VSA理論的市場階段,今天昂首平臺就和投資者一分鐘理清。 根…

第五篇——謀攻篇:韓信該死,拿破侖該亡

目錄 一、背景介紹二、思路&方案三、過程1.思維導圖2.文章中經典的句子理解3.學習之后對于投資市場的理解4.通過這篇文章結合我知道的東西我能想到什么? 四、總結五、升華 一、背景介紹 人生也是如此,傷敵一千,自損八百;而不…

AI繪畫擦邊變現賽道怎么玩?新手小白必看教程!

今天給大家介紹一個用 AI 搞擦邊的變現賽道 而且可以說是0 成本變現的 現在真的越來越多的人都想 0 成本變現,那么 0 成本到底能不能變現,變現的上下限又是多少? 今天這個案例就可以很好的進行說明 可以說 AI 是現在第一生產力&#xff0…

Yarn有哪些功能

Yarn 作為一個 JavaScript 包管理工具,提供了一系列強大的功能,旨在優化依賴管理、提升安裝速度和增強項目的可維護性。以下是 Yarn 的一些主要功能: 1. 依賴管理 鎖定依賴版本:Yarn 使用 yarn.lock 文件來鎖定項目依賴的具體版…

【RT-thread studio 下使用STM32F103-學習sem-信號量-初步使用-線程之間控制-基礎樣例】

【RT-thread studio 下使用STM32F103-學習sem-信號量-初步使用-線程之間控制-基礎樣例】 1、前言2、環境3、事項了解(1)了解sem概念-了解官網消息(2)根據自己理解,設計幾個使用方式(3)不建議運行…

const char * 、char const *、 char * const 三者的區別

一.const char*(常量指針) 1.定義一個指向字符常量的指針,這里,ptr是一個指向 char* 類型的常量,所以不能用ptr來修改所指向的內容,換句話說,*ptr的值為const,不能修改。但是ptr的聲…

【Python機器學習】處理文本數據——停用詞

刪除沒有信息量的單詞有一種方法,就是舍棄那些出現次數太多以至于沒有信息量的單詞。 有兩種主要方法: 1、使用特定語言的停用詞(stopword)列表; 2、舍棄那些出現過于頻繁的單詞。 scikit-learn的feature_extracti…

達夢DM8使用管理工具自動commit設置

緣起 隨著國產化信創大勢崛起,越來越多的國產數據庫躍上潮頭。在用慣了國外數據庫軟件后,使用DM8的過程中前前后后遇到了不少“不習慣”,當然,用多了也就習慣了,要多給國產DB一些成長空間。 功能點探索 DM管理工具…

強烈建議!所有Python基礎差的同學,死磕這本64頁的背記手冊!

Python背記手冊是一份非常實用的學習資料,它涵蓋了Python語言的基礎知識、語法規則、常用函數和模塊等內容,對于初學者和有一定基礎的Python程序員來說都非常有用。通過背誦這份手冊,可以加深對Python語言的理解和記憶,提高編程能…

摸魚大數據——Spark Core——RDD綜合案例——搜狗搜索流

2.1 數據源介紹 訪問時間 用戶id []里面是用戶輸入搜索內容 url結果排名 用戶點擊頁面排序 用戶點擊URL 字段與字段之間的分隔符號為 \t和空格 (制表符號) 2.2 需求分析 需求一: 統計每個 關鍵詞 出現了多少次,最終展示top10數據關鍵詞示例: [.,,的,360, 安全衛士, 哄搶, 救災…

Zabbix觸發器

目錄 觸發器基礎概念 創建和管理觸發器 示例 定義一個觸發器 在 Zabbix 中,觸發器(Trigger)用于定義在監控數據滿足特定條件時觸發警報或動作。觸發器是實現監控告警和自動響應的核心組件之一。以下是關于 Zabbix 觸發器的詳細解釋和用法…

yaml格式轉換成json格式

yaml格式轉換成json格式 ①postman生成的結果是yaml格式 ps:postman輸出的格式是沒有自動換行的,需要將內容換行 ②復制到Python的腳本跑一趟:自動換行并去掉/n; str " "//(postman輸出的內容) print(st…

唐僧說:分數限制下,選好專業還是選好學校?

貧僧自東土大唐而來,往西天取經,雖非塵世中人,卻也常聞世間煩惱。今見24年高考帷幕已落,萬千學子面臨新的人生抉擇,心中不禁生出幾分感慨。學校與專業,猶如修行路上的兩座山門,一者關乎環境氛圍…

HTTPS保證傳輸安全的關鍵點

哈嘍,大家好呀,淼淼又來和大家見面啦,在如今高度數字化的世界里,信息的安全傳輸成為了至關重要的議題。HTTPS(超文本傳輸安全協議)作為HTTP協議的安全升級版,為網絡數據的交換提供了強大的安全保…

LMT加仿真,十一屆大唐杯全國總決賽

這次省賽帶了太多個省一了,并且很多都進入了國賽總決賽,具體可看下面的圖片,只放了一部分。目前只有B組是只有一個商用設備賽也就是LMT,A組和高職組都是仿真實踐賽加上商用設備賽。 針對商用設備賽有對應的資料&#xff…

windows server2016搭建AD域服務器

文章目錄 一、背景二、搭建AD域服務器步驟三、生成可供java程序使用的keystore文件四、導出某用戶的keytab文件五、主機配置hosts文件六、主機確認是否能ping通本人其他相關文章鏈接 一、背景 親測可用,之前搜索了很多博客,啥樣的都有,就是不介紹報錯以…

FastDDS中的環境變量

目錄 FASTDDS_DEFAULT_PROFILES_FILESKIP_DEFAULT_XMLFASTDDS_BUILTIN_TRANSPORTSROS_DISCOVERY_SERVERROS_SUPER_CLIENTFASTDDS_STATISTICSFASTDDS_ENVIRONMENT_FILE 我們承擔ROS,FastDDS,C,cmake等技術的項目開發和專業指導和培訓&#xff…

深度學習算法bert

bert 屬于自監督學習的一種(輸入x的部分作為label) 1. bert是 transformer 中的 encoder ,不同的bert在encoder層數、注意力頭數、隱藏單元數不同 2. 假設我們有一個模型 m ,首先我們為某種任務使用大規模的語料庫預訓練模型 m …